Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scale the fontsizes using Plots.jl

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

Original question from Filippo Vicentini on Slack.

like image 1000
Lufu Avatar asked Sep 17 '19 14:09

Lufu


Video Answer


1 Answers

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.

like image 176
Lufu Avatar answered Oct 02 '22 01:10

Lufu