我不知道在使用numpy.gradient时如何指定非均匀的间距。import matplotlib.pyplot as plt
y = [0.0, 4.0, 16.08.0] #added a zero at the start to get length matching up with y
plt.plotx, dydx
我正在尝试将数据点从数据坐标系转换到matplotlib中的轴坐标系。import matplotlib.pyplot as plt
# this is in data coordinates# returns [1000, 1000], while I expected [0.5, 0.5]ax.set_ylim(0, 2000)
ax.plot(*tra
所以我的问题是如何为函数r = f(theta)做一个极坐标f,通过计算θ的一系列值的r,然后用方程x = r cos(theta),y = r sin(theta)把r和θ转换成笛卡儿坐标。/usr/bin/env python
from math import cos, sin, pi
from numpy importlinspace(0,10*pi)