color_demo.py

来自「非原创。很好的python例子」· Python 代码 · 共 24 行

PY
24
字号
#!/usr/bin/env python"""matplotlib gives you 3 ways to specify colors,    1) as a single letter string, ala matab    2) as an html style hex string or html color name    3) as an R,G,B tuple, where R,G,B, range from 0-1See help(colors) for more info."""from pylab import *subplot(111, axisbg='darkslategray')#subplot(111, axisbg='#ababab')t = arange(0.0, 2.0, 0.01)s = sin(2*pi*t)plot(t, s, 'y')xlabel('time (s)', color='r')ylabel('voltage (mV)', color='k')title('About as silly as it gets, folks', color='#afeeee')show()

⌨️ 快捷键说明

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