I have just started experimenting with matplotlib, since I often come across instances where I need to plot some data, for which matplotlib seems an excellent tool. I attempted to adapt the ellipse example in the main site, so as to draw two circles instead, how ever after running the code, I find that none of the patches are displayed, I am not able to figure out what exactly is wrong… here is the code. Thanks in Advance.
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import matplotlib.patches as mpatches
plt.axis([-3,3,-3,3])
ax = plt.axes([-3,3,-3,3])
# add a circle
art = mpatches.Circle([0,0], radius = 1, color = 'r', axes = ax)
ax.add_artist(art)
#add another circle
art = mpatches.Circle([0,0], radius = 0.1, color = 'b', axes = ax)
ax.add_artist(art)
print ax.patches
plt.show()
Which version of matplotlib are you using? I’m not able to replicate your results, I can see the two ellipsis quite well. I’m going by a long shot, but i guess you mean to do something like this: