I would like to write a function that changes the font of all of the labels in a figure that I pass to it without actually changing the labels themselves.
This is useful for figures that I have already created and need to have a uniform font style.
Currently I am using multiple font dictionaries like so:
titleFont = {'family' : 'Arial',
'weight' : 'bold',
'size' : 20}
axesFont = {'family' : 'Arial',
'weight' : 'bold',
'size' : 18}
axesTickFont = {'family' : 'Arial',
'weight' : 'bold',
'size' : 16}`
And then setting the font sizes by using commands along the lines of:
ax.set_title('My Plot',**titleFont)
The issue is that with the command above, I need to specify a plot title, when all I want to do is set the font style of an existing title.
Something like this would be ideal:
def set_fonts(axis):
axis.set_title(**titleFont)
axis.set_ylabel(**axesFont)
axis.set_xlabel(**axesFont)
return axis