# Edit opacity of Plot3D after creation

I have just created a 3D surface plot with the function Plot3D. Now, I want to change the opacity of the graph, after I have created it, without having to redraw the graph.

I am able to change things like axislabels etc., but I cannot find how I can change the opacity after creation.

Is this possible?

• Does Show[plot, BaseStyle -> Opacity[.5]] work for you? – Carl Woll Aug 15 '17 at 20:01
• That works great! What if I use the function Show[plot1,plot2] and I only want to change the opacity of plot1? If I use Show[plot1, plot1, BaseStyle -> Opacity[.5]], both plots get Opacity 0.5. – Peter Lawrence Aug 15 '17 at 20:17
• Peter, BaseStyle affects everything that is not explicitly styled, so by nature it will affect both plots; there can be only one BaseStyle for the combined Graphics3D expression. Working with the primitives is more flexible. – Mr.Wizard Aug 15 '17 at 20:20
• @anderstood No, that actually doesn't work because only one BaseStyle directive is retained. – Mr.Wizard Aug 15 '17 at 20:28
• Changing a color is harder as you have to replace a directive that already exists in the plot. The method used may need to change depending on the source of the plot. For the example I chose we can use something as simple as plot /. _Directive :> Opacity[.5, Red] – Mr.Wizard Aug 15 '17 at 20:37

plot = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]