Skip to content

Instantly share code, notes, and snippets.

@jonnyhtw
Created February 16, 2016 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonnyhtw/602189c6efc9237874c0 to your computer and use it in GitHub Desktop.
Save jonnyhtw/602189c6efc9237874c0 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy.random as rnd
from matplotlib.patches import Ellipse
NUM = 250
ells = [Ellipse(xy=rnd.rand(2)*10, width=rnd.rand(), height=rnd.rand(), angle=rnd.rand()*360)
for i in range(NUM)]
fig = plt.figure(0)
ax = fig.add_subplot(111, aspect='equal')
for e in ells:
ax.add_artist(e)
e.set_clip_box(ax.bbox)
e.set_alpha(rnd.rand())
e.set_facecolor(rnd.rand(3))
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment