I am new to matlibplot and I\'m trying to draw a circle with radius 1 but have both my x and y axis go from 0 to 3 with an increment of 0.25. Right now, I have drawn the gra
To change the axes range, you can use
plt.xlim([-3, 3])
plt.ylim([-3, 3])
You will then have to remove the line plt.axis('scaled')
for this to work.
import numpy as np
import matplotlib.pyplot as plt
import scipy, pylab
plt.axes()
circle=plt.Circle((0, 0), radius=1, fc='w')
plt.gca().add_patch(circle)
plt.xlim([-3, 3])
plt.ylim([-3, 3])
plt.yticks(np.arange(-3, 3, 0.25))
plt.xticks(np.arange(-3, 3, 0.25))
plt.show()
Use first xticks and yticks before xlim and ylim. This will create an array before it sets the limit