好,现在这只是一个示例代码:
from matplotlib import pyplot
time = [0, 1, 2, 3]
position = [0, 100, 200, 300]
pyplot.plot(time, position)
pyplot.xlabel('Time (hr)')
pyplot.ylabel('Position (km)')
输出为:
= RESTART: C:/Users/Utente/AppData/Local/Programs/Python/Python38/pyplot_test.py
C:/Users/Utente/AppData/Local/Programs/Python/Python38/pyplot_test.py
是此示例代码的路径文件。有帮助吗?
Windows 10
Python 3.8.2
答案 0 :(得分:0)
哦,是的,愚蠢的我,我忘记了pyplot.show()
。现在可以了。