1
$\begingroup$

I need to plot multiple surfaces with textures. Each texture is a matrix plot with transparent background. In this way, we can see the multiple surfaces from the top.

L= 10;
m1 = RandomInteger[{-1, 1}, {L, L}];
m2 = RandomInteger[{-1, 1}, {L, L}];
mp1 = MatrixPlot[m1, Frame -> None, Background -> None, ColorRules -> {0 -> None, -1 -> Red, 1 -> Blue}];
mp2 = MatrixPlot[m2, Frame -> None, Background -> None, ColorRules -> {0 -> None, -1 -> Red, 1 -> Blue}];
mplt1 = Plot3D[1, {x, 0, L}, {y, 0, L}, Lighting -> "Neutral", PlotStyle -> Directive[Texture[mp1]], TextureCoordinateFunction -> Automatic, BoundaryStyle -> None, Mesh -> None, PlotRange -> All, TextureCoordinateScaling -> True, Background -> None];
mplt2 = Plot3D[5, {x, 0, L}, {y, 0, L}, Lighting -> "Neutral", PlotStyle -> Directive[Texture[mp2]], TextureCoordinateFunction -> Automatic, BoundaryStyle -> None, Mesh -> None, PlotRange -> All, TextureCoordinateScaling -> True, Background -> None];
Show[{mplt1,mplt2}]

The image has slight red color on the surface, which I want to make completely transparent. After I overlay 50 sheets of this kind, the red color really mess up the whole picture.

Could anyone help me to manage the reddish color?

Thank you,

enter image description here

$\endgroup$
  • $\begingroup$ Your code has syntax errors, please fix them $\endgroup$ – Dr. belisarius Sep 23 '14 at 17:57
  • $\begingroup$ Sorry, I fixed it. $\endgroup$ – user19983 Sep 23 '14 at 18:05
  • $\begingroup$ Try PlotStyle -> Directive[Texture[Rasterize[mp1, Background -> None]]]. Texture doesn't understand MatrixPlot directly. Alternatively, you can use Raster directly from matrix with correct parameters inside Texture. $\endgroup$ – kirma Sep 23 '14 at 18:09
  • $\begingroup$ Wow, it worked perfectly! Thank you so much!!! $\endgroup$ – user19983 Sep 23 '14 at 18:12
  • $\begingroup$ @kirma You may want to post here mathematica.stackexchange.com/q/35581/193 $\endgroup$ – Dr. belisarius Sep 23 '14 at 18:14