Python Forum

Full Version: Getting error "TypeError: 'int' object is not callable" while using ylim
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi I am getting error "TypeError: 'int' object is not callable" while using ylim function in matplotlib. I want to set limit of x and y axis. my code is given below. I am new to Pyhton. Please help on the matter.
code -

import numpy as np
import matplotlib.pyplot as plt

y_v1=[21,32,14,29,23,26,122]
d2=np.arange(1,8)
plt.plot(d2, y_v1, label='Visits',marker='o', linestyle='dotted')
plt.xlim(1,6)
plt.ylim(1,40)
plt.show()
Please use proper code tags while posting a thread
I'm getting this <Figure size 640x480 with 1 Axes> when I run the code, are you still having the same problem?