Re: How to combine 3D Graphics?
- To: mathgroup at smc.vnet.net
- Subject: [mg126476] Re: How to combine 3D Graphics?
- From: JUN <noeckel at gmail.com>
- Date: Sun, 13 May 2012 03:01:59 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <joi3lp$n45$1@smc.vnet.net>
On Thursday, May 10, 2012 9:13:45 PM UTC-7, Jee Lou wrote: > I have tried to combine a translucent 3D-plot graph with its density plot by using Show. But it doesn't work. Here's my code: > g1=Plot3D[Sin[x + y], {x, 0, Pi}, {y, 0, Pi}, Mesh -> False,PlotStyle->Opacity[.5]]; > g2=DensityPlot[Sin[x + y], {x, 0, Pi}, {y, 0, Pi}, Frame -> False]; > g3=Plot3D[-1, {x, 0, Pi}, {y, 0, Pi}, Mesh -> None,TextureCoordinateFunction -> ({#1, #2} &), PlotStyle -> Directive[Texture[g2]]]; > Show[g1,g3] > It turns out that the density graph disappears T_T. > How can I make it right? Although the plot shows properly in the notebook, I can confirm that it disappears when exporting the result of Show[g1,g3] as a PDF. To fix this, you could try the following modification: g3 = Plot3D[-1, {x, 0, Pi}, {y, 0, Pi}, Mesh -> None, TextureCoordinateFunction -> ({#1, #2} &), PlotStyle -> Directive[Texture[ImageData@Rasterize[g2, "Image"]]]]; This is a bug, and the use of ImageData above is a work-around.