I want to change the font size of the 'ticks' of a chart. At the moment I am using the following instruction to change it only to the graph that I am going to show
plt.tick_params(labelsize = 20)
But just like with
plt.rcParams["figure.figsize"] = [20,10]
I can change the size of all the graphs that I generate, is there something similar to change the font size of the ticks of all the graphs that I generate?
'xtick.labelsize'
You can use the rc and parameters'ytick.labelsize'
:Another very useful option if you are going to modify many properties and you also intend to reuse it is to define your own style, simply create a text file to define the parameters, for example we create the file
customstyle.mplstyle
with the following content:To use it, just pass the path to
plt.style.use
:You can also add the file to
~/.config/matplotlib/stylelib
so that we can reuse the style in the future just by using its name:The directory can vary, in GNU/Linux this is usually the directory, in any case we can find it with:
and in the directory that returns us create the directory
stylelib
and put our styles in it.