Apr-23-2020, 09:44 AM
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()
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()