7

is there a way to rescale all the fontsizes (legend, tickslabels, axislabels…) at once?

Original question from Filippo Vicentini on Slack.

Lufu
  • 436
  • 4
  • 11

1 Answers1

15

Individual font sizes can be controlled with the titlefontsize, tickfontsize, legendfontsize, tickfontsize, guidefontsize and legendtitlefontsize attributes, but I get that this can be quite tedious. There is also the thickness_scaling attribute.

plot(rand(10), thickness_scaling = 0.5)

However, this also affects the line widths. The third option is to call

Plots.scalefontsizes(α)

to scale all font sizes by a factor α. This changes the global fontsize defaults for all subsequent plots and can be undone with

Plots.scalefontsizes(1 / α)

Answer by Daniel Schwabeneder on Slack.

Lufu
  • 436
  • 4
  • 11
  • 2
    You can also use `Plots.scalefontsizes()` without an argument to reset the font size. ([relevant commit](https://github.com/JuliaPlots/Plots.jl/commit/d3b825b49f89f3822da06d3136cee48fba735ca2)) – kongr45gpen Jun 27 '21 at 19:42