简体   繁体   English

Matplotlib plt.plot()在anaconda中不起作用

[英]Matplotlib plt.plot() not working in anaconda

I tried to run this code in spyder IDE of anaconda but it's not working 我试图在anaconda的spyder IDE中运行此代码,但无法正常工作

import matplotlib.pyplot as plt
plt.plot([1,2,3,4,5],[1,4,9,16,25])
plt.show()

The above code is returning error as follows: TypeError: 'tuple' object is not callable 上面的代码返回错误,如下所示:TypeError:'tuple'对象不可调用

I am not able to figure out the problem.Please help 我无法解决问题。请帮助

Not sure if this applies here but I had similar issues with matplotlib. 不知道这是否适用于此,但与matplotlib存在类似问题。 From another Stackoverflow-answer this suggestion helped me: 从另一个Stackoverflow-answer中,该建议帮助我:

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

As said in the comments: the full error would help figuring out what really goes wrong. 正如评论中所说:完全错误将有助于找出真正出了问题的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM