[英]Matplotlib: ValueError: x and y must have same first dimension Error
import numpy as np
import matplotlib.pyplot as plt
x = np.array([1.628,1.548,1,451,1.386,1.280])
y = np.array([0.124,0.086,0.045,0.013,-0.032])
plt.plot(x,y)
plt.show();
Hi, 你好
I know this has been asked before. 我知道这已经被问过了。 I have tried to convert the lists into numpy arrays but unfortunately the same error occurs.
我试图将列表转换为numpy数组,但不幸的是发生了同样的错误。 Can you tell me where I'm going wrong?
你能告诉我我要去哪里了吗?
x定义中有一个虚假逗号: 1,451
而不是1.451
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.