注解
Click here 下载完整的示例代码
向图形添加线条¶
向没有任何轴的图形添加线。
import matplotlib.pyplot as plt
import matplotlib.lines as lines
fig = plt.figure()
fig.add_artist(lines.Line2D([0, 1], [0, 1]))
fig.add_artist(lines.Line2D([0, 1], [1, 0]))
plt.show()

工具书类¶
以下函数、方法、类和模块的使用如本例所示:
import matplotlib
matplotlib.pyplot.figure
matplotlib.lines
matplotlib.lines.Line2D
关键词:matplotlib代码示例,codex,python plot,pyplot Gallery generated by Sphinx-Gallery