欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

line_styles.py

非原创。很好的python例子
PY
字号:
#!/usr/bin/env pythonfrom pylab import *t = arange(0.0, 3.0, 0.05)s = sin(2*pi*t)styles = ('-', '--', ':', '.', 'o', '^', 'v', '<', '>', 's', '+')colors = ('b', 'g', 'r', 'c', 'm', 'y', 'k')axisNum = 0for row in range(5):    for col in range(4):        s = sin(2*pi*t)        axisNum += 1        subplot(5,4,axisNum)        style = styles[axisNum % len(styles) ]        color = colors[axisNum % len(colors) ]        plot(t,s, style + color)        # turn off the ticklabels if not first row or first col        if not gca().is_first_col():            setp(gca(), 'yticklabels', [])        if not gca().is_last_row():            setp(gca(), 'xticklabels', [])        #savefig('line_styles', dpi=300)show()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -