【发布时间】:2020-06-12 15:20:21
【问题描述】:
而不是 y 轴是 1,2,3,4... 有没有办法使它成为 1,4,9,16...? 在网站上找不到任何东西。
这是我的代码:
import matplotlib.pyplot as plt
import numpy as np
x = np.array(range(100))
y = 2 * np.pi * (x/9.81)**(1/2)
plt.figure()
plt.plot(x, y)
plt.title("Graph")
plt.grid(True)
plt.show()
【问题讨论】:
-
您要更改 y 轴刻度还是要为此数据绘制直线?
标签: python numpy matplotlib graphing yaxis