Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
p1 = Plot[x^2, {x, -2, 2}, PlotStyle -> {Thick, Black}]; 
p2 = Graphics3D[{EdgeForm[Black], Texture[p1], 
 Polygon[{{-2, 0, -1}, {2, 0, -1}, {2, 4, -1}, {-2, 4, -1}}, 
 VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}], 
 Opacity[1]}, Lighting -> "Neutral", Boxed -> False];
squares = 
 Polygon[{{-Sqrt[y], y, 0}, {Sqrt[y], y, 0}, {Sqrt[y], y, 
 2 Sqrt[y]}, {-Sqrt[y], y, 2 Sqrt[y]}}]}, Boxed -> False], {y, 0, 4, .25}];
all = Show[Table[squares[[j]], {j, 1, 16}]];
Show[p2, all]

results in this output for me:

However, for others (at least one of whom is a Mac user), indeed the p2 graphic shows up in the second result.

When I click on the cell bracket, and Save As... PDF, the result is

And finally, if I directly copy and paste the figure (rather than export), I get this:

enter image description here

I need some independent confirmation of if this a bug in the Windows 7 version of v8.0.4 and if you have any ideas for workarounds since I need a PDF version of the last figure for insertion into other docs. Thanks.

share|improve this question
I can see the p2 result with 8.0.4 on Windows 7 – b.gatessucks Jul 2 '12 at 16:15
Please only use the tag bugs if the unexpected behaviour is indeed confirmed by the community (see tag wiki). – István Zachar Jul 2 '12 at 16:15
I can confirm I get the same problem with 8.0.4 on Windows 7. There seems to be a general problem with opacity and textures in 3D graphics - if I go to the documentation for Texture neither of the examples in the Generalizations & Extensions section work. – Simon Woods Jul 2 '12 at 21:03
@SimonWoods Could you check this question and confirm if you seem to have the same problem as described there? – Sjoerd C. de Vries Jul 2 '12 at 21:49
@IstvánZachar It is indeed a bug, confirmed by John Fultz, see the link at the end of my posted answer. So I've taken the liberty of adding the bug tag again. – Jens Jul 3 '12 at 5:23
up vote 7 down vote accepted

This non-appearance of the texture is a known bug that also affects Macs. It can be fixed by providing as the Texture only the ImageData of the rasterized graphic. So you have to replace



Texture[ImageData@Rasterize[p1, "Image"]]

and then the texture will show up. I modified your definitions a little, in line with what I already said in this answer:

p1 = Plot[x^2, {x, -2, 2}, PlotStyle -> {Thick, Black}, 
   ImageSize -> 600];

p2 = Graphics3D[{EdgeForm[Black], 
      Rasterize[p1, "Image", ImageResolution -> 120]]], Polygon[
     {{-2, 0, -1}, {2, 0, -1}, {2, 4, -1}, {-2, 4, -1}}, 
     VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}
   Lighting -> "Neutral",
   Boxed -> False,
   ImageSize -> 600

squares = 
     Polygon[{{-Sqrt[y], y, 0}, {Sqrt[y], y, 0}, {Sqrt[y], y, 
        2 Sqrt[y]}, {-Sqrt[y], y, 2 Sqrt[y]}}]}, {y, 0, 4, .25}], 
   Boxed -> False, ImageSize -> 600];

all = Graphics3D[{p2[[1]], squares[[1]]},
  Lighting -> "Neutral",
  Boxed -> False,
  ImageSize -> 600]

Note I added ImageResolution to the Rasterize command to try and make the resulting texture look a little smoother.

The resulting file after Export["file.pdf", all] is here:



A reference for this bug fix is this MathGroup discussion.

share|improve this answer
This does produce the desired result in the exported PDF, but the output of the code in Mathematica still doesn't show the bottom Texture graphic for me. (However, my main concern was the PDF.) – JohnD Jul 3 '12 at 14:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.