Rushikesh Sabde
Rushikesh Sabde

Reputation: 1626

Passing a tuple for plotting in matplotlib throws a "Tuple Object is not callable" error at line no. 3

Please find the output belowI am plotting a graph using matplotlib but python is throwing an error 'Tuple is not callable'

import matplotlib.pyplot as plt

fig, ax = plt.subplots(2, 2)

ax[0, 0].plot(range(10), 'r')
ax[1, 0].plot(range(10), 'b')
ax[0, 1].plot(range(10), 'g')
ax[1, 1].plot(range(10), 'k')
plt.show()

Upvotes: 3

Views: 373

Answers (1)

TVM
TVM

Reputation: 26

Please check your python version because range() function works different in python 2 and python 3

Upvotes: 1

Related Questions