Cannot set label text size or family using axisartist

Using code such as the following:

import mpl_toolkits.axisartist as AA
ax = fig.add_subplot(AA.Subplot(fig, 111))
ax.set_xlabel("something", color="red", family="serif", size="30")

I end up with a red label, but the size and family have not been correctly set. Using fig.add_subplot(111) instead of using axisartist yields the expected results.

Author: Fantashit

1 thought on “Cannot set label text size or family using axisartist

  1. axis in the axisartist is quite different from original axis. And commands related to ticks and ticklabels are likely not work as you expect, while some commands are compatible.

    While I know it is not as complete, please read the user’s guide here.

    With axisartist, you should use

    ax.axis["bottom"].label.set(text="something", color="red",
                                family="serif", size=30)


    ax.axis["bottom"].major_ticklabels.set(color="blue", size=30, family="serif")

Comments are closed.