2
$\begingroup$

For axes label the scaled FontSize works like charm. If I do:

 Plot[Sin[x], {x, 0, 2 π}, 
 AxesLabel -> {Style["x", FontSize -> Scaled[0.04]], 
   Style["sin(x)", FontSize -> Scaled[0.04]]}]

When I grab the handle of the plot and rescale it, the $x$ and $\sin(x)$ labels are scaled with it. More importantly, if I export the plot in a large resolution, like

Export["Test.png", 
 Plot[Sin[x], {x, 0, 2 π}, 
  AxesLabel -> {Style["x", FontSize -> Scaled[0.04]], 
    Style["sin(x)", FontSize -> Scaled[0.04]]}], ImageSize -> 3840]

the text is reasonably big to see it. However, the tick labelings (numbers) are not, so I adjust them too:

Plot[Sin[x], {x, 0, 2 π}, 
 AxesLabel -> {Style["x", FontSize -> Scaled[0.04]], 
   Style["sin(x)", FontSize -> Scaled[0.04]]}, 
 TicksStyle -> Scaled[0.02]]

Ticks just got bigger than default, that's for sure. But if I grab the handle and rescale the plot, they don't rescale with it. No matter what I do, option Scaled just doesn't work here. What should I do? I export various image sizes, I can't adjust the font size individually for every plot.

$\endgroup$
  • 1
    $\begingroup$ try BaseStyle -> {FontSize -> Scaled[0.02]} in place of ` TicksStyle -> Scaled[0.02]`? $\endgroup$ – kglr Mar 22 '17 at 11:08
  • $\begingroup$ Thank you, but that changed also the size of "x" and "sin(x)". How do i prevent that? Will it also work for the frame tims in the case of density plot? $\endgroup$ – user16320 Mar 22 '17 at 12:03

Your Answer

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

Browse other questions tagged or ask your own question.