2
$\begingroup$

I have the plot of two surfaces given by

 pN          = ParametricPlot3D[{0,u,v},{u,-0.25,0.25},{v,-0.5,0.5},\
               Mesh->None,PlotStyle->Directive[Gray,Opacity[0.4]]
               ];
 pS          = ParametricPlot3D[{u,v^2,v},{u,-0.25,0.25},{v,-0.5,0.5},\
               Mesh->None,PlotStyle->Directive[Green,Opacity[0.4]]
               ];

Then, I combine the two surfaces on the same plot with

  Show[pN,pS]

and I can export my figure.

I would like to create a text legend (or a automatic text label) for these two surfaces (maybe a color designation would be easier to begin with).

I tried :

 pN          = Legended[\
                 ParametricPlot3D[{0,u,v},{u,-0.25,0.25},{v,-0.5,0.5}]\
               ,"My Text for Surface N"]

but we can't determine what surface this piece of text refers to.

$\endgroup$
2
$\begingroup$
ParametricPlot3D[{{0, u, v}, {u, v^2, v}}, {u, -0.25, 0.25}, {v, -0.5, 0.5},
Mesh -> None, PlotStyle -> {Directive[Gray, Opacity[0.4]],
Directive[Green, Opacity[0.4]]}, 
PlotLegends -> 
SwatchLegend[{Directive[Gray, Opacity[0.4]], 
Directive[Green, Opacity[0.4]]}, {"pN", "pS"}]]

enter image description here

To add different meshes it is better have separate plots and then combine them:

ParametricPlot3D[{0, u, v}, {u, -0.25, 0.25}, {v, -0.5, 0.5}, 
Mesh -> None, PlotStyle -> {Directive[Gray, Opacity[0.4]]}, 
PlotLegends -> SwatchLegend[{Directive[Gray, Opacity[0.4]]}, {"pN"}]]

ParametricPlot3D[{u, v^2, v}, {u, -0.25, 0.25}, {v, -0.5, 0.5}, 
Mesh -> 5, PlotStyle -> {Directive[Green, Opacity[0.4]]}, 
PlotLegends -> 
SwatchLegend[{Directive[Green, Opacity[0.4]]}, {"pS"}]]

Show[%,%%]

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ thanks, what is I would like to customize the mesh style for eaach surface: for the green, I would like Mesh=None and for the blue I would like Mesh=5. Mesh -> {None,5} doesn't seem to work. Or if I would like to add a RegionFunction, how can I specify different function for each surface ? $\endgroup$ – Smilia Oct 31 '19 at 13:52
  • $\begingroup$ I edited answer to have different meshes. Thanks for accepting! $\endgroup$ – Alx Oct 31 '19 at 14:00
3
$\begingroup$
 ParametricPlot3D[{{0, u, v}, {u, v^2, v}}, {u, -0.25, 0.25}, {v, -0.5, 0.5}, 
    MeshFunctions -> {# &, #3 Boole[# != 0] &}, 
    Mesh -> 5, 
    PlotStyle -> (Opacity[0.4, #] & /@ {Gray, Green}), 
    PlotLegends -> {"pN", "pS"}]

enter image description here

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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