One shouldn't use set_yticklabels
to change the fontsize, since this will also set the labels (i.e. it will replace any automatic formatter by a FixedFormatter
), which is usually undesired. The easiest is to set the respective tick_params
:
ax.tick_params(axis="x", labelsize=8)
ax.tick_params(axis="y", labelsize=20)
or
ax.tick_params(labelsize=8)
in case both axes shall have the same size.
Of course using the rcParams as in @tmdavison's answer is possible as well.