Increasing font size in axis ticks

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Increasing font size in axis ticks

Bugzilla from david.kremer.dk@gmail.com
Hello,

I know how one can increase the font size in the xlabel and ylabel
fields. I use the methode presented in:

http://matplotlib.sourceforge.net/examples/pylab_examples/dannys_example.html

But I don't know how to increase the font size for the numbers labelling
the xticks or the yticks, and found nothing in the doc. May you help ?

David

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Increasing font size in axis ticks

Tony Yu-3


On Thu, Jul 5, 2012 at 8:12 AM, David Kremer <[hidden email]> wrote:
Hello,

I know how one can increase the font size in the xlabel and ylabel
fields. I use the methode presented in:

http://matplotlib.sourceforge.net/examples/pylab_examples/dannys_example.html

But I don't know how to increase the font size for the numbers labelling
the xticks or the yticks, and found nothing in the doc. May you help ?

David


Hi David,

You can call `tick_params`; e.g.,

    plt.tick_params(labelsize=20)

If you want to change just one axis

    ax.xaxis.set_tick_params(labelsize=20)

This assumes your axes object (from `plt.subplots`, `fig.add_subplot`, `plt.gca()`, etc.) is named `ax` .

Best,
-Tony


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users