Matplotlib 绘图函数plot 教程
Matplotlib
Matplotlib 是 Python 的绘图库,它能让使用者很轻松地将数据图形化,并且提供多样化的输出格式。
Matplotlib 可以用来绘制各种静态,动态,交互式的图表。
Matplotlib 是一个非常强大的 Python 画图工具,我们可以使用该工具将很多数据通过图表的形式更直观的呈现出来。
Matplotlib 可以绘制线图、散点图、等高线图、条形图、柱状图、3D 图形、甚至是图形动画等等。
matplotlib.pyplot.plot
可选参数列表
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array |
|
scalar or None |
|
bool |
|
|
bool |
bool |
|
Patch or (Path, Transform) or None |
|
|
color |
|
|
|
|
sequence of floats (on/off ink in points) or (None, None) |
|
(2, N) array or two 1D arrays |
|
|
{'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default' |
{'full', 'left', 'right', 'bottom', 'top', 'none'} |
|
str |
|
bool |
|
object |
|
|
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
|
float |
marker style string, |
|
|
color |
|
float |
|
color |
|
color |
|
float |
None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool] |
|
float or callable[[Artist, Event], tuple[bool, dict]] |
|
float |
|
bool |
|
(scale: float, length: float, randomness: float) |
|
bool or None |
|
|
|
|
|
unknown |
|
str |
|
bool |
|
1D array |
|
1D array |
|
float |
Markers 点的类型
character |
description |
---|---|
|
point marker |
|
pixel marker |
|
circle marker |
|
triangle_down marker |
|
triangle_up marker |
|
triangle_left marker |
|
triangle_right marker |
|
tri_down marker |
|
tri_up marker |
|
tri_left marker |
|
tri_right marker |
|
octagon marker |
|
square marker |
|
pentagon marker |
|
plus (filled) marker |
|
star marker |
|
hexagon1 marker |
|
hexagon2 marker |
|
plus marker |
|
x marker |
|
x (filled) marker |
|
diamond marker |
|
thin_diamond marker |
|
vline marker |
|
hline marker |
参考
https://www.runoob.com/matplotlib/matplotlib-tutorial.html
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html