0
$\begingroup$

I have this:

VectorDensityPlot[{x, -y}, {x, -5, 5}, {y, -5, 5}, 
 PlotLegends -> Automatic]

and want to:

1) Add a label to the column bar legend on the side 2) Change the font size and style to Latin Modern Roman (LaTeX).

I managed to increase the font size with FrameTicks, but not the style. There aren't many examples around with VectorDensityPlot... I found loads for plot alone, but most of them don't work on VectorDensityPlot...

$\endgroup$
  • $\begingroup$ You should be able to do a lot of this with the BaseStyle option, give that a try. $\endgroup$ – Jason B. Jun 27 '16 at 22:09
3
$\begingroup$

To format the plot legend you will have to go beyond PlotLegends -> Automatic. Here is an example of a formatted plot legend.

VectorDensityPlot[{x, -y}, {x, -5, 5}, {y, -5, 5}, 
 PlotLegends -> 
   BarLegend[Automatic, LegendLabel -> "Cooper Std", 
   LabelStyle -> {Bold, 16, FontFamily -> "Cooper Std"}]]

plot

$\endgroup$
3
$\begingroup$

To extend m_goldberg's answer, the legend functions (BarLegend, LineLegend, PointLegend, and SwatchLegend) use the plot's LabelStyle, by default. So, you can set the LabelStyle for the entire plot, if you want uniformity, e.g.

VectorDensityPlot[{x, -y}, {x, -5, 5}, {y, -5, 5}, 
 PlotLegends -> BarLegend[Automatic, LegendLabel -> "Cooper Std"], 
 LabelStyle -> {Bold, 16, FontFamily -> "Cooper Std"}]

enter image description here

$\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.