简体   繁体   English

Matplotlib:ValueError:x和y必须具有相同的第一维错误

[英]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.

相关问题 Matplotlib:ValueError:x 和 y 必须具有相同的第一维 - Matplotlib: ValueError: x and y must have same first dimension 输入错误,然后输入值错误:x 和 y 必须具有相同的第一维 - Type error, and then ValueError: x and y must have same first dimension Matplotlib 'ValueError: x 和 y 必须具有相同的第一维,但具有形状 (20,) 和 (1,)' - Matplotlib 'ValueError: x and y must have same first dimension, but have shapes (20,) and (1,)' ValueError: x 和 y 必须具有相同的第一维,但有形状,tkinter 和 matplotlib 问题 - ValueError: x and y must have same first dimension, but have shapes, tkinter and matplotlib problem Matplotlib 中的 Plot K-Means:ValueError:x 和 y 必须具有相同的第一个维度,但具有形状 (10,) 和 (1,) - Plot K-Means in Matplotlib: ValueError: x and y must have same first dimension, but have shapes (10,) and (1,) ValueError:x 和 y 必须具有相同的第一维,但具有形状 (1, 2) 和 (2,) - ValueError: x and y must have same first dimension, but have shapes (1, 2) and (2,) ValueError:x 和 y 必须具有相同的第一维,但具有形状 - ValueError: x and y must have same first dimension, but have shapes ValueError:x 和 y 必须具有相同的第一维,但具有形状 (6,) 和 (8,) - ValueError: x and y must have same first dimension, but have shapes (6,) and (8,) Python ValueError:x 和 y 必须具有相同的第一维 - Python ValueError: x and y must have same first dimension 绘图:ValueError:x 和 y 必须具有相同的第一维 - Plotting: ValueError: x and y must have same first dimension
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM