4
$\begingroup$

Let's say I have this plot.

enter image description here

It was produced using two different Plot3D commands combined via Show in order to reduce the opacity of only one of them.

s[p0_] := Sign[Re[p0]] Sign[Im[p0]]

Show[Plot3D[s[rep0 + I imp0], {rep0, -1, 1}, {imp0, -1, 1}], 
 Plot3D[0, {rep0, -1, 1}, {imp0, -1, 1}, 
  PlotStyle -> Directive[Blue, Opacity[0.1]]]]

Obviously, it would have been nicer, to include both graphs in one Plot3D command like so,

Plot3D[{s[rep0 + I imp0],0}, {rep0, -1, 1}, {imp0, -1, 1}]

However, I couldn't figure out how to then apply the opacity setting only to the second graph. Is this possible?

$\endgroup$

closed as off-topic by MarcoB, Feyre, corey979, m_goldberg, happy fish Dec 8 '16 at 3:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, Feyre, corey979, m_goldberg, happy fish
If this question can be reworded to fit the rules in the help center, please edit the question.

8
$\begingroup$

You just need to give a list to PlotStyle:

s[p0_] := Sign[Re[p0]] Sign[Im[p0]];
Plot3D[
  {s[rep0 + I imp0], 0},
  {rep0, -1, 1},
  {imp0, -1, 1},
  PlotStyle -> {Automatic, Directive[Blue, Opacity[0.1]]}
]

DifferentStyles

$\endgroup$
  • $\begingroup$ That was surprisingly simple. Thanks! $\endgroup$ – Casimir Dec 7 '16 at 16:13

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