3

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.

corey979
  • 23,947
  • 7
  • 58
  • 101
user16320
  • 2,396
  • 15
  • 25
  • 1
    try BaseStyle -> {FontSize -> Scaled[0.02]} in place of TicksStyle -> Scaled[0.02]? – kglr Mar 22 '17 at 11:08
  • 1
    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? – user16320 Mar 22 '17 at 12:03

0 Answers0