1
$\begingroup$

I am trying to plot a 3D vector field and I want to also attach a labeled-legend to it, but it appears that LegendLabel is not an option for VectorPlot3D. How can I get around this? I want to specify the legend label as the "Magnitude" of the vector field, such as

VectorPlot3D[{x, y, z}, {x, -4, 4}, {y, -4, 4}, {z, -4, 4}, 
 PlotLegends -> Automatic]

enter image description here Magnitude enter image description here

or something akin. Thanks for any help!

$\endgroup$
3
$\begingroup$
VectorPlot3D[{x, y, z}, {x, -4, 4}, {y, -4, 4}, {z, -4, 4}, 
  PlotLegends -> BarLegend[Automatic, LegendLabel -> "magnitude"]]

enter image description here

$\endgroup$
1
  • $\begingroup$ So simple :) Thank you! $\endgroup$ – shanedrum Feb 19 at 11:45

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.