0
$\begingroup$

When using DensityPlot or similar, I want to change the font size of both frame labels and the color bar legend, but I can only get the frame labels to work.

Example:

DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}, PlotLegends -> Automatic, 
BaseStyle -> {FontSize -> 30}]

enter image description here

$\endgroup$
3
$\begingroup$
labels = Directive[FontSize -> 24, Black, Italic];

DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}, 
 PlotLegends -> BarLegend[{"LakeColors", {-1, 1}}, LabelStyle -> labels], 
 LabelStyle -> labels]

enter image description here

$\endgroup$
2
$\begingroup$

Here is an example

DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}, 
    PlotLegends -> BarLegend["LakeColors", 
        LabelStyle -> {FontSize -> 30,     FontFamily -> "Helvetica"}], 
    BaseStyle -> {FontSize -> 30, FontFamily -> "Helvetica"}
]

More information in Mathematica 9 documentation.

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