File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""
22This example shows how to use a path patch to draw a bunch of
3- rectangles. The technique of using lots of Rectangle instances, or
4- the faster method of using PolyCollections, were implemented before we
5- had proper paths with moveto/lineto, closepoly etc in mpl. Now that
6- we have them, we can draw collections of regularly shaped objects with
7- homogeous properties more efficiently with a PathCollection. This
8- example makes a histogram -- its more work to set up the vertex arrays
9- at the outset, but it should be much faster for large numbers of
10- objects
3+ rectangles for an animated histogram
114"""
12- import time
135import numpy as np
146import matplotlib
157matplotlib .use ('TkAgg' ) # do this before importing pylab
6052ax .set_ylim (bottom .min (), top .max ())
6153
6254def animate ():
63- tstart = time .time () # for profiling
6455 # simulate new data coming in
6556 data = np .random .randn (1000 )
6657 n , bins = np .histogram (data , 100 )
You can’t perform that action at this time.
0 commit comments