如何用python matplotlab 画出一个分段函数

2025-04-28 20:59:36
推荐回答(1个)
回答1:

几个绘图的例子,来自API手册:
1、最简单的图:
代码:
[python] view plain copy print?
#!/usr/bin/env python
import matplotlib.pyplot as plt

plt.plot([10, 20, 30])
plt.xlabel('tiems')
plt.ylabel('numbers')
plt.show()