Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6433e8e

Browse files
committed
two new examples using a compund path for a histogram; one animated
svn path=/branches/v0_99_maint/; revision=7430
1 parent cd88e29 commit 6433e8e

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

examples/animation/histogram_tkagg.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
"""
22
This 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
135
import numpy as np
146
import matplotlib
157
matplotlib.use('TkAgg') # do this before importing pylab
@@ -60,7 +52,6 @@
6052
ax.set_ylim(bottom.min(), top.max())
6153

6254
def 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)

0 commit comments

Comments
 (0)