Python–Matplotlib(基本用法)
python绘制三维图
画一条线plot(x,y3,color='#900302',marker='+',linestyle='-')
画多条线 plt.plot(x,y,"bo-",x,z,"g1--",x,m,"kv:")
"g1–"
颜色(color),点型(marker),线型(linestyle),
‘[color][marker][line]’
import numpy as np
from matplotlib import pyplot as plt
x = np.arange(1,11,2)
print(x)
y = np.sin(x)
z =2*np.cos(10*x)
m =2*x+3
plt.title("Matplotlib demo")
plt.xlabel("x axis caption")
plt.ylabel("测试")
plt.plot(x,y,"bo-",x,z,"g1--",x,m,"kv:")
plt.show()
============= ===============================
character 颜色(color)
============= ===============================
``'b'`` blue 蓝
``'g'`` green 绿
``'r'`` red 红
``'c'`` cyan 蓝绿
``'m'`` magenta 洋红
``'y'`` yellow 黄
``'k'`` black 黑
``'w'`` white 白
============= ===============================
============= ===============================
character 点型(marker)
============= ===============================
``'.'`` point marker
``','`` pixel marker
``'o'`` circle marker
``'v'`` triangle_down marker
``'^'`` triangle_up marker
``'
``'>'`` triangle_right marker
``'1'`` tri_down marker
``'2'`` tri_up marker
``'3'`` tri_left marker
``'4'`` tri_right marker
``'s'`` square marker
``'p'`` pentagon marker
``'*'`` star marker
``'h'`` hexagon1 marker
``'H'`` hexagon2 marker
``'+'`` plus marker
``'x'`` x marker
``'D'`` diamond marker
``'d'`` thin_diamond marker
``'|'`` vline marker
``'_'`` hline marker
============= ===============================
============= ===============================
character 线型(linestyle)
============= ===============================
``'-'`` solid line style 实线
``'--'`` dashed line style 虚线
``'-.'`` dash-dot line style 点画线
``':'`` dotted line style 点线
============= ===============================