I really can't get this and I need to superimpose an ellipse onto an image. The problem is plotting the ellipse with the matplotlib.patches, but ending up with either a white graph or a filled ellipse. The code is very primitive and I'm not sure what to do, since I've never worked with this part of the matplotlib library.
import matplotlib.pyplot as plt
import numpy.random as rnd
from matplotlib.patches import Ellipse
ells = [Ellipse(xy=[0,0], width=30, height=10, angle=0,edgecolor='b', lw=4)]
fig = plt.figure(0)
ax = fig.add_subplot(111, aspect='equal')
for e in ells:
ax.add_artist(e)
e.set_alpha(1)
e.set_facecolor(none) #obvious mistake, but no idea what to do
ax.set_xlim(-100, 100)
ax.set_ylim(-100, 100)
plt.show()
I tried looking up the matplotlib.patches page, but there is no clear info on how to plot an ellipse, just the function in use.
Would greatly appreciate some help.
Thank you for your time.
'none'
. – Joe Kingtone.set_fill(False)
If the goal was a "unfilled" elipse – M4rtini