Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Tuple is not callable' in Python [closed]

I've got error in Python while trying to plot something like this:

import matplotlib.pyplot as plt

plt.plot(list_x,list_y)

As I mentioned in title this error is:

'tuple' object is not callable 

I was wondering what's wrong with my code, but then I realized that this error appears even when I'm pasting correct code (for example: http://matplotlib.org/examples/pylab_examples/accented_text.html ).

This is weird. Thanks for advance for any helping tips.

like image 640
nikodamn Avatar asked Dec 02 '25 10:12

nikodamn


1 Answers

As mentioned in the comments, you may have accidentally overwritten the value of plt.plot

Python 2.7.5+ (default, Feb 27 2014, 19:37:08) 
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> plt.plot
<function plot at 0x2285488>

If the problem persists in a new interpreter, you should see what the tuple is that plt.plot displays. Maybe that is a clue to what has gone wrong.

like image 143
John La Rooy Avatar answered Dec 04 '25 01:12

John La Rooy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!