Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Cannot set label text size or family using axisartist #615

Closed
ukch opened this Issue Dec 8, 2011 · 4 comments

Comments

Projects
None yet
3 participants

ukch commented Dec 8, 2011

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.

ukch commented Dec 8, 2011

It is also imporrible to set text size or family, or even colour, on the tik labels. Here's the code I've been using:

...
plt.setp(ax.get_xticklabels(), color="blue", size=30, family="serif")
...

This also works fine using just regular axes.

@ghost ghost assigned leejjoon Dec 9, 2011

Contributor

leejjoon commented Dec 10, 2011

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.

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axisartist.html

With axisartist, you should use

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

and

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

ukch commented Dec 13, 2011

OK, thanks for the tip. Considering the two different APIs, I feel like axisartist objects shouldn't have access to the normal APIs, bearing in mind the normal APIs don't actually work with axisartist. Otherwise this is just too confusing!

Owner

efiring commented May 29, 2013

I conclude this can be closed.

@efiring efiring closed this May 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment