thank you for your reply. when i try either of the first suggestions about changing the fonts, i get the error:
AttributeError: 'FontProperties' object has no attribute 'get_slant'
any idea what this means?
also, i do not mind setting the position of each tickmark individually but i cannot find a way to do this -- could you please explain how this can be done?
> but it does not work. i tried similarly setting the font size (withIt seems that changing rcParams is not effective because of the way
> set_size() or through rcParams) but it did not work either. how can i do
> this? i'd like to do this either on per axes basis, or for the entire
how the font caching is done. Here is a little monkey patching to
change this behavior.
from matplotlib.font_manager import FontProperties
l = dict([(k, getattr(self, "get" + k)()) for k in self.__dict__])
FontProperties.__hash__ = my_hash
With this code, changing rcParams will affect (most of) the text in the figure.
As far as I know, you cannot have a default font properties on per
axes basis. You need to manually change the font properties of Text
artists in your interests.
For example, to change the font properties of the xtick labels,
fp = FontProperties(family="Lucida Sans Typewriter")
ax = gca()
for t in ax.get_xticklabels():
I don't think there is a smart way to prevent it other than manually
> second, how can i make it so axes labels do not overlap? in many plots,
> including ones in the gallery, you see the labels at the origin of plots get
> too close to each other. (i.e. the 0.0 of x-axis and 0.0 of y-axis) - how
> can you prevent this from happening?
changing the tick positions. Other may have better ideas.