Movatterモバイル変換


[0]ホーム

URL:


You are reading an old version of the documentation (v2.0.0). For the latest version seehttps://matplotlib.org/stable/
matplotlib

Navigation


Travis-CI:

Related Topics

This Page

Quick search

ticks_and_spines example code: ticklabels_demo_rotation.py

(Source code,png,pdf)

../../_images/ticklabels_demo_rotation.png
"""Demo of custom tick-labels with user-defined rotation."""importmatplotlib.pyplotaspltx=[1,2,3,4]y=[1,4,9,6]labels=['Frogs','Hogs','Bogs','Slogs']plt.plot(x,y,'ro')# You can specify a rotation for the tick labels in degrees or with keywords.plt.xticks(x,labels,rotation='vertical')# Pad margins so that markers don't get clipped by the axesplt.margins(0.2)# Tweak spacing to prevent clipping of tick-labelsplt.subplots_adjust(bottom=0.15)plt.show()

Keywords: python, matplotlib, pylab, example, codex (seeSearch examples)

© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2016 The Matplotlib development team. Last updated on Feb 20, 2017. Created usingSphinx 1.5.2.

[8]ページ先頭

©2009-2025 Movatter.jp