📄 major_minor_demo2.py
字号:
#!/usr/bin/env python"""Set the major ticks on the ints and minor ticks on multiples of 0.2"""from pylab import *from matplotlib.ticker import MultipleLocator, FormatStrFormattermajorLocator = MultipleLocator(1)majorFormatter = FormatStrFormatter('%d')minorLocator = MultipleLocator(.2)t = arange(0.0, 10.0, 0.01)s = sin(2*pi*t)*exp(-t*0.01)ax = subplot(111)plot(t,s)ax.xaxis.set_major_locator(majorLocator)ax.xaxis.set_major_formatter(majorFormatter)#for the minor ticks, use no labels; default NullFormatterax.xaxis.set_minor_locator(minorLocator) show()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -