Plotting a solid circle on a polar plot

Hello,

this seems like it should be easy but I am beating my head on the wall here.

I am trying to fill in everything rad<=1 in a polar plot (this is a spacecraft orbit trace and the circle is the Earth) and can't seem to get it.

from pylab import *
from matplotlib.patches import Circle
fig=figure()
ax = fig.add_subplot(111, polar=True)
ax.plot([2,2,2,2], [2,3,4,5])
el = Circle((0,0), radius=1,facecolor='black', axes=ax)
ax.add_artist(el)
draw()
# also get the same result plotting with polar()

and of course this dumbell looks nothing like the earth :slight_smile:

thanks much for any help,

Brian

···

--
-----------------------------------------------------------
Brian A Larsen, PhD
RBSP-ECT Instrument Suite Scientist

Boston University
Center for Space Physics
725 Commonwealth Ave, Rm 506
Boston, MA 02215-1401
T: 617-358-4945
F: 617-353-6463
balarsen@...728...

Hi Brian,

does
ax.fill_between(np.linspace(0.0, 2*np.pi,100), np.ones(100))
do what you are after?

Kind regards
Matthias

···

On Wednesday 02 December 2009 16:42:16 Brian Larsen wrote:

Hello,

this seems like it should be easy but I am beating my head on the wall
here.

I am trying to fill in everything rad<=1 in a polar plot (this is a
spacecraft orbit trace and the circle is the Earth) and can't seem to get
it.

from pylab import *
from matplotlib.patches import Circle
fig=figure()
ax = fig.add_subplot(111, polar=True)
ax.plot([2,2,2,2], [2,3,4,5])
el = Circle((0,0), radius=1,facecolor='black', axes=ax)
ax.add_artist(el)
draw()
# also get the same result plotting with polar()

and of course this dumbell looks nothing like the earth :slight_smile:

thanks much for any help,

Brian