I am trying to plot a circle on a grid. The code that I have written is as follows:
import pyplot as plt
from pyplot import Figure, subplot
fig=plt.figure(1)
plt.axis([0,400,0,400])
ax=fig.add_subplot(1,1,1)
circ=plt.Circle((200,200), radius=10, color='g', fill=False)
ax.add_patch(circ)
plt.show()
Now, I want the center of the circle to be the center of the graph, that is, (200,200) in this example. In case of other cases I want it to automatically choose the centre depending on the size that us set. Can this be in some way?
To make it clearer I want to get the x-axis and the y-axis range so as to find the mid point of the grid. How do I proceed?