1
$\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$
0

2 Answers 2

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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