You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jd...@us...> - 2008-05-16 20:47:12
|
Revision: 5161
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5161&view=rev
Author: jdh2358
Date: 2008-05-16 13:47:09 -0700 (Fri, 16 May 2008)
Log Message:
-----------
updated api readme
Modified Paths:
--------------
trunk/matplotlib/examples/api/README.txt
Modified: trunk/matplotlib/examples/api/README.txt
===================================================================
--- trunk/matplotlib/examples/api/README.txt 2008-05-16 20:34:35 UTC (rev 5160)
+++ trunk/matplotlib/examples/api/README.txt 2008-05-16 20:47:09 UTC (rev 5161)
@@ -11,7 +11,7 @@
- the matplotlib artist tutorial :
http://matplotlib.sourceforge.net/pycon/artist_api_tut.pdf
- - the "leftwich tutorial" -
+ - the "leftwich tutorial" :
http://matplotlib.sourceforge.net/leftwich_tut.txt
The example agg_oo.py is the simplest example of using the Agg
@@ -22,3 +22,27 @@
the API for everything else. This is a good solution for production
quality scripts. For full fledged GUI applications, see the
user_interfaces examples.
+
+Example style guide
+===================
+
+If you are creating new examples, you cannot import pylab or import *
+from any module in your examples. The only three functions allowed
+from pyplot are "figure", "show" and "close", which you can use as
+convenience functions for managing figures. All other matplotlib
+functionality must illustrate the API.
+
+A simple example of the recommended style is::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111) # or add_axes
+ ax.plot(np.random.rand(10))
+ ax.set_xlabel('some x data')
+ ax.set_ylabel('some y data')
+ ax.set_title('some title')
+ ax.grid(True)
+ fig.savefig('myfig')
+ plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 20:34:42
|
Revision: 5160
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5160&view=rev
Author: jdh2358
Date: 2008-05-16 13:34:35 -0700 (Fri, 16 May 2008)
Log Message:
-----------
added the new backend driver
Added Paths:
-----------
trunk/matplotlib/examples/tests/backend_driver.py
Added: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py (rev 0)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-05-16 20:34:35 UTC (rev 5160)
@@ -0,0 +1,238 @@
+#!/usr/bin/env python
+"""
+This is used to drive many of the examples across the backends, for
+regression testing, and comparing backend efficiency.
+
+The script takes one or more arguments specifying backends
+to be tested, e.g.
+
+ python backend_driver.py agg ps cairo.png cairo.ps
+
+would test the agg and ps backends, and the cairo backend with
+output to png and ps files.
+
+If no arguments are given, a default list of backends will be
+tested.
+"""
+
+from __future__ import division
+import os, time, sys
+import matplotlib.backends as mplbe
+
+pylab_dir = os.path.join('..', 'pylab')
+pylab_files = [
+ 'alignment_test.py',
+ 'arctest.py',
+ 'arrow_demo.py',
+ 'auto_layout.py',
+ 'axes_demo.py',
+ 'axhspan_demo.py',
+ 'bar_stacked.py',
+ 'barchart_demo.py',
+ 'boxplot_demo.py',
+ 'broken_barh.py',
+ 'barh_demo.py',
+ 'color_demo.py',
+ 'cohere_demo.py',
+ 'contour_demo.py',
+ 'contourf_demo.py',
+ 'csd_demo.py',
+ 'custom_ticker1.py',
+ 'customize_rc.py',
+ 'date_demo1.py',
+ 'date_demo2.py',
+ 'equal_aspect_ratio.py',
+ 'errorbar_limits.py',
+ 'figimage_demo.py',
+ 'figlegend_demo.py',
+ 'figtext.py',
+ 'fill_demo.py',
+ 'finance_demo.py',
+ 'fonts_demo_kw.py',
+ 'hexbin_demo.py',
+ 'histogram_demo.py',
+ 'hline_demo.py',
+ 'image_demo.py',
+ 'image_demo2.py',
+ 'image_masked.py',
+ 'image_origin.py',
+ 'invert_axes.py',
+ 'layer_images.py',
+ 'legend_auto.py',
+ 'legend_demo.py',
+ 'legend_demo2.py',
+ 'line_collection.py',
+ 'line_collection2.py',
+ 'line_styles.py',
+ 'log_demo.py',
+ 'log_test.py',
+ 'major_minor_demo1.py',
+ 'major_minor_demo2.py',
+ 'masked_demo.py',
+ 'mathtext_demo.py',
+ 'mri_with_eeg.py',
+ 'multiple_figs_demo.py',
+ 'nan_test.py',
+ 'pcolor_demo.py',
+ 'pcolor_demo2.py',
+ 'pcolor_small.py',
+ 'pie_demo.py',
+ 'polar_demo.py',
+ 'polar_scatter.py',
+ 'psd_demo.py',
+ 'quadmesh_demo.py',
+ 'quiver_demo.py',
+ 'scatter_demo.py',
+ 'scatter_demo2.py',
+ 'scatter_star_poly.py',
+ 'shared_axis_demo.py',
+ 'shared_axis_across_figures.py',
+ 'simple_plot.py',
+ 'specgram_demo.py',
+ 'spy_demos.py',
+ 'stem_plot.py',
+ 'step_demo.py',
+ 'stock_demo.py',
+ 'subplot_demo.py',
+# 'set_and_get.py',
+ 'table_demo.py',
+ 'text_handles.py',
+ 'text_rotation.py',
+ 'text_themes.py',
+# 'tex_demo.py',
+ 'two_scales.py',
+ 'unicode_demo.py',
+ 'vline_demo.py',
+ 'xcorr_demo.py',
+ 'zorder_demo.py',
+ ]
+
+
+api_dir = os.path.join('..', 'api')
+api_files = [
+ 'colorbar_only.py',
+]
+
+
+files = [os.path.join(pylab_dir, fname) for fname in pylab_files] +\
+ [os.path.join(api_dir, fname) for fname in api_files]
+# tests known to fail on a given backend
+
+
+failbackend = dict(
+ SVG = ('tex_demo.py,'),
+ )
+
+try:
+ import subprocess
+ def run(arglist):
+ try:
+ subprocess.call(arglist)
+ except KeyboardInterrupt:
+ sys.exit()
+except ImportError:
+ def run(arglist):
+ os.system(' '.join(arglist))
+
+def drive(backend, python=['python'], switches = []):
+ exclude = failbackend.get(backend, [])
+
+ # Clear the destination directory for the examples
+ path = backend
+ if os.path.exists(path):
+ import glob
+ for fname in os.listdir(path):
+ os.unlink(os.path.join(path,fname))
+ else:
+ os.mkdir(backend)
+
+ for fullpath in files:
+
+ print ('\tdriving %-40s' % (fullpath)),
+ sys.stdout.flush()
+
+ fpath, fname = os.path.split(fullpath)
+
+ if fname in exclude:
+ print '\tSkipping %s, known to fail on backend: %s'%backend
+ continue
+
+ basename, ext = os.path.splitext(fname)
+ outfile = os.path.join(path,basename)
+ tmpfile_name = '_tmp_%s.py' % basename
+ tmpfile = file(tmpfile_name, 'w')
+
+ for line in file(fullpath):
+ line_lstrip = line.lstrip()
+ if line_lstrip.startswith("#"):
+ tmpfile.write(line)
+ else:
+ break
+
+ tmpfile.writelines((
+ 'from __future__ import division\n',
+ 'import sys\n',
+ 'sys.path.append("%s")\n'%fpath,
+ 'import matplotlib\n',
+ 'matplotlib.use("%s")\n' % backend,
+ 'from pylab import savefig\n',
+ ))
+ for line in file(fullpath):
+ line_lstrip = line.lstrip()
+ if (line_lstrip.startswith('from __future__ import division') or
+ line_lstrip.startswith('matplotlib.use') or
+ line_lstrip.startswith('savefig') or
+ line_lstrip.startswith('show')):
+ continue
+ tmpfile.write(line)
+ if backend in mplbe.interactive_bk:
+ tmpfile.write('show()')
+ else:
+ tmpfile.write('savefig("%s", dpi=150)' % outfile)
+
+ tmpfile.close()
+ start_time = time.time()
+ program = [x % {'name': basename} for x in python]
+ run(program + [tmpfile_name, switchstring])
+ end_time = time.time()
+ print (end_time - start_time)
+ #os.system('%s %s %s' % (python, tmpfile_name, switchstring))
+ os.remove(tmpfile_name)
+
+if __name__ == '__main__':
+ times = {}
+ default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template']
+ if '--coverage' in sys.argv:
+ python = ['coverage.py', '-x']
+ sys.argv.remove('--coverage')
+ elif '--valgrind' in sys.argv:
+ python = ['valgrind', '--tool=memcheck', '--leak-check=yes',
+ '--log-file=%(name)s', 'python']
+ sys.argv.remove('--valgrind')
+ elif sys.platform == 'win32':
+ python = [r'c:\Python24\python.exe']
+ else:
+ python = ['python']
+ all_backends = [b.lower() for b in mplbe.all_backends]
+ all_backends.extend(['cairo.png', 'cairo.ps', 'cairo.pdf', 'cairo.svg'])
+ backends = []
+ switches = []
+ if sys.argv[1:]:
+ backends = [b.lower() for b in sys.argv[1:] if b.lower() in all_backends]
+ switches = [s for s in sys.argv[1:] if s.startswith('--')]
+ if not backends:
+ backends = default_backends
+ for backend in backends:
+ switchstring = ' '.join(switches)
+ print 'testing %s %s' % (backend, switchstring)
+ t0 = time.time()
+ drive(backend, python, switches)
+ t1 = time.time()
+ times[backend] = (t1-t0)/60.0
+
+ # print times
+ for backend, elapsed in times.items():
+ print 'Backend %s took %1.2f minutes to complete' % ( backend, elapsed)
+ if 'Template' in times:
+ print '\ttemplate ratio %1.3f, template residual %1.3f' % (
+ elapsed/times['Template'], elapsed-times['Template'])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 20:32:31
|
Revision: 5159
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5159&view=rev
Author: jdh2358
Date: 2008-05-16 13:32:18 -0700 (Fri, 16 May 2008)
Log Message:
-----------
more example readmes
Modified Paths:
--------------
trunk/matplotlib/examples/api/README.txt
trunk/matplotlib/examples/event_handling/README.txt
Added Paths:
-----------
trunk/matplotlib/examples/animation/README.txt
Added: trunk/matplotlib/examples/animation/README.txt
===================================================================
--- trunk/matplotlib/examples/animation/README.txt (rev 0)
+++ trunk/matplotlib/examples/animation/README.txt 2008-05-16 20:32:18 UTC (rev 5159)
@@ -0,0 +1,7 @@
+matplotlib animations
+=====================
+
+There are a variety of techniques you can use to create dynamic plots,
+which I refer to as animations. See the tutorial at
+http://www.scipy.org/Cookbook/Matplotlib/Animations for an
+introduction to the basic concepts
Modified: trunk/matplotlib/examples/api/README.txt
===================================================================
--- trunk/matplotlib/examples/api/README.txt 2008-05-16 20:25:07 UTC (rev 5158)
+++ trunk/matplotlib/examples/api/README.txt 2008-05-16 20:32:18 UTC (rev 5159)
@@ -1,3 +1,6 @@
+matplotlib API
+==============
+
These examples use the matplotlib api rather than the pylab/pyplot
procedural state machine. For robust, production level scripts, or
for applications or web application servers, we recommend you use the
Modified: trunk/matplotlib/examples/event_handling/README.txt
===================================================================
--- trunk/matplotlib/examples/event_handling/README.txt 2008-05-16 20:25:07 UTC (rev 5158)
+++ trunk/matplotlib/examples/event_handling/README.txt 2008-05-16 20:32:18 UTC (rev 5159)
@@ -1,3 +1,6 @@
+matplotlib event handling
+=========================
+
matplotlib supports event handling with a GUI neutral event model. So
you can connect to matplotlib events w/o knowledge of what user
interface matplotlib will ultimately be plugged in to. This has two
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 20:25:36
|
Revision: 5158
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5158&view=rev
Author: jdh2358
Date: 2008-05-16 13:25:07 -0700 (Fri, 16 May 2008)
Log Message:
-----------
added a few example specific readmes
Added Paths:
-----------
trunk/matplotlib/examples/api/README.txt
trunk/matplotlib/examples/event_handling/README.txt
trunk/matplotlib/examples/user_interfaces/README.txt
Added: trunk/matplotlib/examples/api/README.txt
===================================================================
--- trunk/matplotlib/examples/api/README.txt (rev 0)
+++ trunk/matplotlib/examples/api/README.txt 2008-05-16 20:25:07 UTC (rev 5158)
@@ -0,0 +1,21 @@
+These examples use the matplotlib api rather than the pylab/pyplot
+procedural state machine. For robust, production level scripts, or
+for applications or web application servers, we recommend you use the
+matplotlib API directly as it gives you the maximum control over your
+figures, axes and plottng commands. There are a few documentation
+resources for the API
+
+ - the matplotlib artist tutorial :
+ http://matplotlib.sourceforge.net/pycon/artist_api_tut.pdf
+
+ - the "leftwich tutorial" -
+ http://matplotlib.sourceforge.net/leftwich_tut.txt
+
+ The example agg_oo.py is the simplest example of using the Agg
+ backend which is readily ported to other output formats. This
+ example is a good starting point if your are a web application
+ developer. Many of the other examples in this directory use
+ matplotlib.pyplot just to create the figure and show calls, and use
+ the API for everything else. This is a good solution for production
+ quality scripts. For full fledged GUI applications, see the
+ user_interfaces examples.
Added: trunk/matplotlib/examples/event_handling/README.txt
===================================================================
--- trunk/matplotlib/examples/event_handling/README.txt (rev 0)
+++ trunk/matplotlib/examples/event_handling/README.txt 2008-05-16 20:25:07 UTC (rev 5158)
@@ -0,0 +1,15 @@
+matplotlib supports event handling with a GUI neutral event model. So
+you can connect to matplotlib events w/o knowledge of what user
+interface matplotlib will ultimately be plugged in to. This has two
+advantages: the code you write will be more portable, and matplotlib
+events are aware of things like data coordinate space and whih axes
+the event occurs in so you don't have to mess with low level
+transformation details to go from canvas space to data space. Object
+picking examples are also included.
+
+There is an event handling tutorial at
+http://matplotlib.sourceforge.net/pycon/event_handling_tut.pdf. The
+ReST source for this document is included in the matplotlib source
+distribution.
+
+
Added: trunk/matplotlib/examples/user_interfaces/README.txt
===================================================================
--- trunk/matplotlib/examples/user_interfaces/README.txt (rev 0)
+++ trunk/matplotlib/examples/user_interfaces/README.txt 2008-05-16 20:25:07 UTC (rev 5158)
@@ -0,0 +1,13 @@
+Embedding matplotlib in graphical user interfaces
+=================================================
+
+You can embed matplotlib directly into a user interface application by
+following the embedding_in_SOMEGUI.py examples here. Currently
+matplotlib supports wxpython, pygtk, tkinter, pyqt, fltk and cocoa.
+
+When embedding matplotlib in a GUI, you must use the matplotlib API
+directly rather than the pylab/pyplot proceedural interface, so take a
+look at the examples/api directory for some example code working with
+the API.
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-05-16 20:15:41
|
Revision: 5157
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5157&view=rev
Author: jswhit
Date: 2008-05-16 13:15:36 -0700 (Fri, 16 May 2008)
Log Message:
-----------
convert more examples to pyplot and numpy namespaces.
Modified Paths:
--------------
trunk/toolkits/basemap/examples/simpletest.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
Modified: trunk/toolkits/basemap/examples/simpletest.py
===================================================================
--- trunk/toolkits/basemap/examples/simpletest.py 2008-05-16 20:09:54 UTC (rev 5156)
+++ trunk/toolkits/basemap/examples/simpletest.py 2008-05-16 20:15:36 UTC (rev 5157)
@@ -1,22 +1,23 @@
from mpl_toolkits.basemap import Basemap
-from pylab import load, show, title, meshgrid, cm, arange
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
# read in topo data (on a regular lat/lon grid)
-etopo=load('etopo20data.gz')
-lons=load('etopo20lons.gz')
-lats=load('etopo20lats.gz')
+etopo=mlab.load('etopo20data.gz')
+lons=mlab.load('etopo20lons.gz')
+lats=mlab.load('etopo20lats.gz')
# create Basemap instance for Robinson projection.
m = Basemap(projection='robin',lon_0=0.5*(lons[0]+lons[-1]))
# make filled contour plot.
-x, y = m(*meshgrid(lons, lats))
-cs = m.contourf(x,y,etopo,30,cmap=cm.jet)
+x, y = m(*np.meshgrid(lons, lats))
+cs = m.contourf(x,y,etopo,30,cmap=plt.cm.jet)
# draw coastlines.
m.drawcoastlines()
# draw a line around the map region.
m.drawmapboundary()
# draw parallels and meridians.
-m.drawparallels(arange(-60.,90.,30.),labels=[1,0,0,0])
-m.drawmeridians(arange(0.,420.,60.),labels=[0,0,0,1])
+m.drawparallels(np.arange(-60.,90.,30.),labels=[1,0,0,0])
+m.drawmeridians(np.arange(0.,420.,60.),labels=[0,0,0,1])
# add a title.
-title('Robinson Projection')
-show()
-
+plt.title('Robinson Projection')
+plt.show()
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-05-16 20:09:54 UTC (rev 5156)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-05-16 20:15:36 UTC (rev 5157)
@@ -305,23 +305,25 @@
Example Usage:
>>> from mpl_toolkits.basemap import Basemap
- >>> from pylab import load, meshgrid, title, arange, show
+ >>> import numpy as np
+ >>> import matplotlib.pyplot as plt
+ >>> import matplotlib.mlab as mlab
>>> # read in topo data (on a regular lat/lon grid)
- >>> etopo = load('etopo20data.gz')
- >>> lons = load('etopo20lons.gz')
- >>> lats = load('etopo20lats.gz')
+ >>> etopo = mlab.load('etopo20data.gz')
+ >>> lons = mlab.load('etopo20lons.gz')
+ >>> lats = mlab.load('etopo20lats.gz')
>>> # create Basemap instance for Robinson projection.
>>> m = Basemap(projection='robin',lon_0=0.5*(lons[0]+lons[-1]))
>>> # compute native map projection coordinates for lat/lon grid.
- >>> x, y = m(*meshgrid(lons,lats))
+ >>> x, y = m(*np.meshgrid(lons,lats))
>>> # make filled contour plot.
- >>> cs = m.contourf(x,y,etopo,30,cmap=cm.jet)
+ >>> cs = m.contourf(x,y,etopo,30,cmap=plt.cm.jet)
>>> m.drawcoastlines() # draw coastlines
>>> m.drawmapboundary() # draw a line around the map region
- >>> m.drawparallels(arange(-90.,120.,30.),labels=[1,0,0,0]) # draw parallels
- >>> m.drawmeridians(arange(0.,420.,60.),labels=[0,0,0,1]) # draw meridians
- >>> title('Robinson Projection') # add a title
- >>> show()
+ >>> m.drawparallels(np.arange(-90.,120.,30.),labels=[1,0,0,0]) # draw parallels
+ >>> m.drawmeridians(np.arange(0.,420.,60.),labels=[0,0,0,1]) # draw meridians
+ >>> plt.title('Robinson Projection') # add a title
+ >>> plt.show()
[this example (simpletest.py) plus many others can be found in the
examples directory of source distribution. The "OO" version of this
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 20:10:00
|
Revision: 5156
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5156&view=rev
Author: jdh2358
Date: 2008-05-16 13:09:54 -0700 (Fri, 16 May 2008)
Log Message:
-----------
moved new hist examples to pylab
Added Paths:
-----------
trunk/matplotlib/examples/pylab/histogram_demo_cumulative.py
trunk/matplotlib/examples/pylab/histogram_demo_step.py
Removed Paths:
-------------
trunk/matplotlib/examples/histogram_demo_cumulative.py
trunk/matplotlib/examples/histogram_demo_step.py
Deleted: trunk/matplotlib/examples/histogram_demo_cumulative.py
===================================================================
--- trunk/matplotlib/examples/histogram_demo_cumulative.py 2008-05-16 20:09:09 UTC (rev 5155)
+++ trunk/matplotlib/examples/histogram_demo_cumulative.py 2008-05-16 20:09:54 UTC (rev 5156)
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-from pylab import *
-
-mu, sigma = 100, 25
-x = mu + sigma*randn(10000)
-
-# the histogram of the data
-n, bins, patches = hist(x, 50, normed=1, histtype='step', cumulative=True)
-setp(patches, 'facecolor', 'g', 'alpha', 0.75)
-
-# add a 'best fit' line
-y = normpdf( bins, mu, sigma).cumsum()
-y /= y[-1]
-l = plot(bins, y, 'k--', linewidth=1.5)
-
-# overlay the first histogram with a second one
-# were the data has a smaller standard deviation
-mu, sigma = 100, 10
-x = mu + sigma*randn(10000)
-
-n, bins, patches = hist(x, bins=bins, normed=1, histtype='step', cumulative=True)
-setp(patches, 'facecolor', 'r', 'alpha', 0.25)
-
-# add a 'best fit' line
-y = normpdf( bins, mu, sigma).cumsum()
-y /= y[-1]
-l = plot(bins, y, 'k--', linewidth=1.5)
-
-grid(True)
-ylim(0, 1.1)
-
-#savefig('histogram_demo',dpi=72)
-show()
\ No newline at end of file
Deleted: trunk/matplotlib/examples/histogram_demo_step.py
===================================================================
--- trunk/matplotlib/examples/histogram_demo_step.py 2008-05-16 20:09:09 UTC (rev 5155)
+++ trunk/matplotlib/examples/histogram_demo_step.py 2008-05-16 20:09:54 UTC (rev 5156)
@@ -1,31 +0,0 @@
-#!/usr/bin/env python
-from pylab import *
-
-mu, sigma = 100, 15
-x = mu + sigma*randn(10000)
-
-# the histogram of the data
-n, bins, patches = hist(x, 50, normed=1, histtype='step')
-setp(patches, 'facecolor', 'g', 'alpha', 0.75)
-
-# add a 'best fit' line
-y = normpdf( bins, mu, sigma)
-l = plot(bins, y, 'k--', linewidth=1)
-
-
-# overlay the first histogram with a second one
-# were the data has a smaller standard deviation
-mu, sigma = 100, 5
-x = mu + sigma*randn(10000)
-
-n, bins, patches = hist(x, 50, normed=1, histtype='step')
-setp(patches, 'facecolor', 'r', 'alpha', 0.25)
-
-y = normpdf( bins, mu, sigma)
-l = plot(bins, y, 'k--', linewidth=1)
-
-axis([40, 160, 0, 0.09])
-grid(True)
-
-#savefig('histogram_demo',dpi=72)
-show()
Copied: trunk/matplotlib/examples/pylab/histogram_demo_cumulative.py (from rev 5154, trunk/matplotlib/examples/histogram_demo_cumulative.py)
===================================================================
--- trunk/matplotlib/examples/pylab/histogram_demo_cumulative.py (rev 0)
+++ trunk/matplotlib/examples/pylab/histogram_demo_cumulative.py 2008-05-16 20:09:54 UTC (rev 5156)
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+from pylab import *
+
+mu, sigma = 100, 25
+x = mu + sigma*randn(10000)
+
+# the histogram of the data
+n, bins, patches = hist(x, 50, normed=1, histtype='step', cumulative=True)
+setp(patches, 'facecolor', 'g', 'alpha', 0.75)
+
+# add a 'best fit' line
+y = normpdf( bins, mu, sigma).cumsum()
+y /= y[-1]
+l = plot(bins, y, 'k--', linewidth=1.5)
+
+# overlay the first histogram with a second one
+# were the data has a smaller standard deviation
+mu, sigma = 100, 10
+x = mu + sigma*randn(10000)
+
+n, bins, patches = hist(x, bins=bins, normed=1, histtype='step', cumulative=True)
+setp(patches, 'facecolor', 'r', 'alpha', 0.25)
+
+# add a 'best fit' line
+y = normpdf( bins, mu, sigma).cumsum()
+y /= y[-1]
+l = plot(bins, y, 'k--', linewidth=1.5)
+
+grid(True)
+ylim(0, 1.1)
+
+#savefig('histogram_demo',dpi=72)
+show()
\ No newline at end of file
Copied: trunk/matplotlib/examples/pylab/histogram_demo_step.py (from rev 5154, trunk/matplotlib/examples/histogram_demo_step.py)
===================================================================
--- trunk/matplotlib/examples/pylab/histogram_demo_step.py (rev 0)
+++ trunk/matplotlib/examples/pylab/histogram_demo_step.py 2008-05-16 20:09:54 UTC (rev 5156)
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+from pylab import *
+
+mu, sigma = 100, 15
+x = mu + sigma*randn(10000)
+
+# the histogram of the data
+n, bins, patches = hist(x, 50, normed=1, histtype='step')
+setp(patches, 'facecolor', 'g', 'alpha', 0.75)
+
+# add a 'best fit' line
+y = normpdf( bins, mu, sigma)
+l = plot(bins, y, 'k--', linewidth=1)
+
+
+# overlay the first histogram with a second one
+# were the data has a smaller standard deviation
+mu, sigma = 100, 5
+x = mu + sigma*randn(10000)
+
+n, bins, patches = hist(x, 50, normed=1, histtype='step')
+setp(patches, 'facecolor', 'r', 'alpha', 0.25)
+
+y = normpdf( bins, mu, sigma)
+l = plot(bins, y, 'k--', linewidth=1)
+
+axis([40, 160, 0, 0.09])
+grid(True)
+
+#savefig('histogram_demo',dpi=72)
+show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 20:09:14
|
Revision: 5155
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5155&view=rev
Author: jdh2358
Date: 2008-05-16 13:09:09 -0700 (Fri, 16 May 2008)
Log Message:
-----------
added changelog entry
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-16 20:08:39 UTC (rev 5154)
+++ trunk/matplotlib/CHANGELOG 2008-05-16 20:09:09 UTC (rev 5155)
@@ -1,3 +1,5 @@
+2008-05-16 Reorganized examples dir
+
2008-05-16 Added 'elinewidth' keyword arg to errorbar, based on patch
by Christopher Brown - MM
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 20:08:43
|
Revision: 5154
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5154&view=rev
Author: jdh2358
Date: 2008-05-16 13:08:39 -0700 (Fri, 16 May 2008)
Log Message:
-----------
added readme for examples
Added Paths:
-----------
trunk/matplotlib/examples/README.txt
Added: trunk/matplotlib/examples/README.txt
===================================================================
--- trunk/matplotlib/examples/README.txt (rev 0)
+++ trunk/matplotlib/examples/README.txt 2008-05-16 20:08:39 UTC (rev 5154)
@@ -0,0 +1,42 @@
+matplotlib examples
+===================
+
+There are a variety of ways to use matplotlib, and most of them are
+illustrated in the examples in this directory.
+
+Probably the most common way people use matplotlib is with the
+procedural interface, which follows the matlab/IDL/mathematica
+approach of using simple procedures like "plot" or "title" to modify
+the current figure. These examples are included in the "pylab"
+directory. If you want to write more robust scripts, eg for
+production use or in a web application server, you will probably want
+to use the matplotlib API for full control. These examples are found
+in the "api" directory. Below is a brief description of the different
+directories found here:
+
+ * animation - dynamic plots, see the tutorial at
+ http://www.scipy.org/Cookbook/Matplotlib/Animations
+
+ * api - working with the matplotlib API directory. See the
+ doc/artist_api_tut.txt in the matplotlib src directory ((PDF at
+ http://matplotlib.sf.net/pycon)
+
+ * data - some data files we use in the examples
+
+ * event_handling - how to interact with your figure, mouse presses,
+ key presses, object picking, etc. See the event handling tutorial
+ in the "doc" directory of the source distribution (PDF at
+ http://matplotlib.sf.net/pycon)
+
+ * misc - some miscellaneous examples. some demos for loading and
+ working with record arrays
+
+ * pylab - the interface to matplotlib similar to matlab
+
+ * tests - tests used by matplotlib developers to check functionality
+
+ * units - working with unit data an custom types in matplotlib
+
+ * user_interfaces - using matplotlib in a GUI application, eg
+ TkInter, WXPython, pygtk, pyqt or FLTK widgets
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 19:51:42
|
Revision: 5153
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5153&view=rev
Author: jdh2358
Date: 2008-05-16 12:51:33 -0700 (Fri, 16 May 2008)
Log Message:
-----------
renamed pylot to api for examples
Added Paths:
-----------
trunk/matplotlib/examples/api/
trunk/matplotlib/examples/api/agg_oo.py
Removed Paths:
-------------
trunk/matplotlib/examples/pylab/agg_oo.py
trunk/matplotlib/examples/pyplot/
Copied: trunk/matplotlib/examples/api (from rev 5151, trunk/matplotlib/examples/pyplot)
Copied: trunk/matplotlib/examples/api/agg_oo.py (from rev 5151, trunk/matplotlib/examples/pylab/agg_oo.py)
===================================================================
--- trunk/matplotlib/examples/api/agg_oo.py (rev 0)
+++ trunk/matplotlib/examples/api/agg_oo.py 2008-05-16 19:51:33 UTC (rev 5153)
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+"""
+A pure OO (look Ma, no pylab!) example using the agg backend
+"""
+from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
+from matplotlib.figure import Figure
+
+fig = Figure()
+canvas = FigureCanvas(fig)
+ax = fig.add_subplot(111)
+ax.plot([1,2,3])
+ax.set_title('hi mom')
+ax.grid(True)
+ax.set_xlabel('time')
+ax.set_ylabel('volts')
+canvas.print_figure('test')
Deleted: trunk/matplotlib/examples/pylab/agg_oo.py
===================================================================
--- trunk/matplotlib/examples/pylab/agg_oo.py 2008-05-16 19:49:55 UTC (rev 5152)
+++ trunk/matplotlib/examples/pylab/agg_oo.py 2008-05-16 19:51:33 UTC (rev 5153)
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-"""
-A pure OO (look Ma, no pylab!) example using the agg backend
-"""
-from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
-from matplotlib.figure import Figure
-
-fig = Figure()
-canvas = FigureCanvas(fig)
-ax = fig.add_subplot(111)
-ax.plot([1,2,3])
-ax.set_title('hi mom')
-ax.grid(True)
-ax.set_xlabel('time')
-ax.set_ylabel('volts')
-canvas.print_figure('test')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 19:50:03
|
Revision: 5152
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5152&view=rev
Author: jdh2358
Date: 2008-05-16 12:49:55 -0700 (Fri, 16 May 2008)
Log Message:
-----------
reorganized examples
Removed Paths:
-------------
trunk/matplotlib/examples/pylab/backend_driver.py
Deleted: trunk/matplotlib/examples/pylab/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/pylab/backend_driver.py 2008-05-16 19:47:10 UTC (rev 5151)
+++ trunk/matplotlib/examples/pylab/backend_driver.py 2008-05-16 19:49:55 UTC (rev 5152)
@@ -1,227 +0,0 @@
-#!/usr/bin/env python
-"""
-This is used to drive many of the examples across the backends, for
-regression testing, and comparing backend efficiency.
-
-The script takes one or more arguments specifying backends
-to be tested, e.g.
-
- python backend_driver.py agg ps cairo.png cairo.ps
-
-would test the agg and ps backends, and the cairo backend with
-output to png and ps files.
-
-If no arguments are given, a default list of backends will be
-tested.
-"""
-
-from __future__ import division
-import os, time, sys
-import matplotlib.backends as mplbe
-
-pylab_files = 'pylab', [
- 'alignment_test.py',
- 'arctest.py',
- 'arrow_demo.py',
- 'auto_layout.py',
- 'axes_demo.py',
- 'axhspan_demo.py',
- 'bar_stacked.py',
- 'barchart_demo.py',
- 'boxplot_demo.py',
- 'broken_barh.py',
- 'barh_demo.py',
- 'color_demo.py',
- 'cohere_demo.py',
- 'contour_demo.py',
- 'contourf_demo.py',
- 'csd_demo.py',
- 'custom_ticker1.py',
- 'customize_rc.py',
- 'date_demo1.py',
- 'date_demo2.py',
- 'equal_aspect_ratio.py',
- 'errorbar_limits.py',
- 'figimage_demo.py',
- 'figlegend_demo.py',
- 'figtext.py',
- 'fill_demo.py',
- 'finance_demo.py',
- 'fonts_demo_kw.py',
- 'hexbin_demo.py',
- 'histogram_demo.py',
- 'hline_demo.py',
- 'image_demo.py',
- 'image_demo2.py',
- 'image_masked.py',
- 'image_origin.py',
- 'invert_axes.py',
- 'layer_images.py',
- 'legend_auto.py',
- 'legend_demo.py',
- 'legend_demo2.py',
- 'line_collection.py',
- 'line_collection2.py',
- 'line_styles.py',
- 'log_demo.py',
- 'log_test.py',
- 'major_minor_demo1.py',
- 'major_minor_demo2.py',
- 'masked_demo.py',
- 'mathtext_demo.py',
- 'mri_with_eeg.py',
- 'multiple_figs_demo.py',
- 'nan_test.py',
- 'pcolor_demo.py',
- 'pcolor_demo2.py',
- 'pcolor_small.py',
- 'pie_demo.py',
- 'polar_demo.py',
- 'polar_scatter.py',
- 'psd_demo.py',
- 'quadmesh_demo.py',
- 'quiver_demo.py',
- 'scatter_demo.py',
- 'scatter_demo2.py',
- 'scatter_star_poly.py',
- 'shared_axis_demo.py',
- 'shared_axis_across_figures.py',
- 'simple_plot.py',
- 'specgram_demo.py',
- 'spy_demos.py',
- 'stem_plot.py',
- 'step_demo.py',
- 'stock_demo.py',
- 'subplot_demo.py',
-# 'set_and_get.py',
- 'table_demo.py',
- 'text_handles.py',
- 'text_rotation.py',
- 'text_themes.py',
-# 'tex_demo.py',
- 'two_scales.py',
- 'unicode_demo.py',
- 'vline_demo.py',
- 'xcorr_demo.py',
- 'zorder_demo.py',
- ]
-
-
-pyplot_files = 'pyplot', [
- 'colorbar_only.py',
-]
-
-
-# tests known to fail on a given backend
-
-failbackend = dict(
- SVG = ('tex_demo.py,'),
- )
-
-try:
- import subprocess
- def run(arglist):
- try:
- subprocess.call(arglist)
- except KeyboardInterrupt:
- sys.exit()
-except ImportError:
- def run(arglist):
- os.system(' '.join(arglist))
-
-def drive(backend, python=['python'], switches = []):
- exclude = failbackend.get(backend, [])
-
- # Clear the destination directory for the examples
- path = backend
- if os.path.exists(path):
- import glob
- for fname in os.listdir(path):
- os.unlink(os.path.join(path,fname))
- else:
- os.mkdir(backend)
-
- for fname in files:
- if fname in exclude:
- print '\tSkipping %s, known to fail on backend: %s'%backend
- continue
-
- print ('\tdriving %-40s' % (fname)),
- sys.stdout.flush()
- basename, ext = os.path.splitext(fname)
- outfile = os.path.join(path,basename)
- tmpfile_name = '_tmp_%s.py' % basename
- tmpfile = file(tmpfile_name, 'w')
-
- for line in file(fname):
- line_lstrip = line.lstrip()
- if line_lstrip.startswith("#"):
- tmpfile.write(line)
- else:
- break
-
- tmpfile.writelines((
- 'from __future__ import division\n',
- 'import matplotlib\n',
- 'matplotlib.use("%s")\n' % backend,
- 'from pylab import savefig\n',
- ))
- for line in file(fname):
- line_lstrip = line.lstrip()
- if (line_lstrip.startswith('from __future__ import division') or
- line_lstrip.startswith('matplotlib.use') or
- line_lstrip.startswith('savefig') or
- line_lstrip.startswith('show')):
- continue
- tmpfile.write(line)
- if backend in mplbe.interactive_bk:
- tmpfile.write('show()')
- else:
- tmpfile.write('savefig("%s", dpi=150)' % outfile)
-
- tmpfile.close()
- start_time = time.time()
- program = [x % {'name': basename} for x in python]
- run(program + [tmpfile_name, switchstring])
- end_time = time.time()
- print (end_time - start_time)
- #os.system('%s %s %s' % (python, tmpfile_name, switchstring))
- os.remove(tmpfile_name)
-
-if __name__ == '__main__':
- times = {}
- default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template']
- if '--coverage' in sys.argv:
- python = ['coverage.py', '-x']
- sys.argv.remove('--coverage')
- elif '--valgrind' in sys.argv:
- python = ['valgrind', '--tool=memcheck', '--leak-check=yes',
- '--log-file=%(name)s', 'python']
- sys.argv.remove('--valgrind')
- elif sys.platform == 'win32':
- python = [r'c:\Python24\python.exe']
- else:
- python = ['python']
- all_backends = [b.lower() for b in mplbe.all_backends]
- all_backends.extend(['cairo.png', 'cairo.ps', 'cairo.pdf', 'cairo.svg'])
- backends = []
- switches = []
- if sys.argv[1:]:
- backends = [b.lower() for b in sys.argv[1:] if b.lower() in all_backends]
- switches = [s for s in sys.argv[1:] if s.startswith('--')]
- if not backends:
- backends = default_backends
- for backend in backends:
- switchstring = ' '.join(switches)
- print 'testing %s %s' % (backend, switchstring)
- t0 = time.time()
- drive(backend, python, switches)
- t1 = time.time()
- times[backend] = (t1-t0)/60.0
-
- # print times
- for backend, elapsed in times.items():
- print 'Backend %s took %1.2f minutes to complete' % ( backend, elapsed)
- if 'Template' in times:
- print '\ttemplate ratio %1.3f, template residual %1.3f' % (
- elapsed/times['Template'], elapsed-times['Template'])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 19:48:10
|
Revision: 5151
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5151&view=rev
Author: jdh2358
Date: 2008-05-16 12:47:10 -0700 (Fri, 16 May 2008)
Log Message:
-----------
reorganized examples
Added Paths:
-----------
trunk/matplotlib/examples/animation/
trunk/matplotlib/examples/animation/animation_blit.py
trunk/matplotlib/examples/animation/animation_blit_fltk.py
trunk/matplotlib/examples/animation/animation_blit_qt.py
trunk/matplotlib/examples/animation/animation_blit_qt4.py
trunk/matplotlib/examples/animation/animation_blit_tk.py
trunk/matplotlib/examples/animation/animation_blit_wx.py
trunk/matplotlib/examples/animation/dynamic_collection.py
trunk/matplotlib/examples/animation/dynamic_demo_wx.py
trunk/matplotlib/examples/animation/dynamic_image_wxagg.py
trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py
trunk/matplotlib/examples/event_handling/
trunk/matplotlib/examples/event_handling/lasso_demo.py
trunk/matplotlib/examples/event_handling/pick_event_demo.py
trunk/matplotlib/examples/event_handling/zoom_window.py
trunk/matplotlib/examples/misc/
trunk/matplotlib/examples/misc/font_indexing.py
trunk/matplotlib/examples/misc/ftface_props.py
trunk/matplotlib/examples/misc/rc_traits.py
trunk/matplotlib/examples/misc/rec_groupby_demo.py
trunk/matplotlib/examples/misc/rec_join_demo.py
trunk/matplotlib/examples/pylab/
trunk/matplotlib/examples/pylab/README
trunk/matplotlib/examples/pylab/__init__.py
trunk/matplotlib/examples/pylab/accented_text.py
trunk/matplotlib/examples/pylab/agg_buffer_to_array.py
trunk/matplotlib/examples/pylab/agg_oo.py
trunk/matplotlib/examples/pylab/alignment_test.py
trunk/matplotlib/examples/pylab/anim.py
trunk/matplotlib/examples/pylab/annotation_demo.py
trunk/matplotlib/examples/pylab/anscombe.py
trunk/matplotlib/examples/pylab/arctest.py
trunk/matplotlib/examples/pylab/arrow_demo.py
trunk/matplotlib/examples/pylab/auto_layout.py
trunk/matplotlib/examples/pylab/axes_demo.py
trunk/matplotlib/examples/pylab/axes_props.py
trunk/matplotlib/examples/pylab/axhspan_demo.py
trunk/matplotlib/examples/pylab/axis_equal_demo.py
trunk/matplotlib/examples/pylab/backend_driver.py
trunk/matplotlib/examples/pylab/bar_stacked.py
trunk/matplotlib/examples/pylab/barchart_demo.py
trunk/matplotlib/examples/pylab/barcode_demo.py
trunk/matplotlib/examples/pylab/barh_demo.py
trunk/matplotlib/examples/pylab/boxplot_demo.py
trunk/matplotlib/examples/pylab/break.py
trunk/matplotlib/examples/pylab/broken_barh.py
trunk/matplotlib/examples/pylab/clippedline.py
trunk/matplotlib/examples/pylab/cohere_demo.py
trunk/matplotlib/examples/pylab/color_by_yvalue.py
trunk/matplotlib/examples/pylab/color_demo.py
trunk/matplotlib/examples/pylab/colours.py
trunk/matplotlib/examples/pylab/contour_demo.py
trunk/matplotlib/examples/pylab/contour_image.py
trunk/matplotlib/examples/pylab/contourf_demo.py
trunk/matplotlib/examples/pylab/contourf_log.py
trunk/matplotlib/examples/pylab/coords_demo.py
trunk/matplotlib/examples/pylab/coords_report.py
trunk/matplotlib/examples/pylab/csd_demo.py
trunk/matplotlib/examples/pylab/cursor_demo.py
trunk/matplotlib/examples/pylab/custom_figure_class.py
trunk/matplotlib/examples/pylab/custom_projection_example.py
trunk/matplotlib/examples/pylab/custom_scale_example.py
trunk/matplotlib/examples/pylab/custom_ticker1.py
trunk/matplotlib/examples/pylab/customize_rc.py
trunk/matplotlib/examples/pylab/dannys_example.py
trunk/matplotlib/examples/pylab/dash_control.py
trunk/matplotlib/examples/pylab/dashpointlabel.py
trunk/matplotlib/examples/pylab/dashtick.py
trunk/matplotlib/examples/pylab/data_browser.py
trunk/matplotlib/examples/pylab/data_helper.py
trunk/matplotlib/examples/pylab/date_demo1.py
trunk/matplotlib/examples/pylab/date_demo2.py
trunk/matplotlib/examples/pylab/date_demo_convert.py
trunk/matplotlib/examples/pylab/date_demo_rrule.py
trunk/matplotlib/examples/pylab/date_index_formatter.py
trunk/matplotlib/examples/pylab/dynamic_demo.py
trunk/matplotlib/examples/pylab/dynamic_image_gtkagg.py
trunk/matplotlib/examples/pylab/ellipse_demo.py
trunk/matplotlib/examples/pylab/ellipse_rotated.py
trunk/matplotlib/examples/pylab/equal_aspect_ratio.py
trunk/matplotlib/examples/pylab/errorbar_demo.py
trunk/matplotlib/examples/pylab/errorbar_limits.py
trunk/matplotlib/examples/pylab/figimage_demo.py
trunk/matplotlib/examples/pylab/figlegend_demo.py
trunk/matplotlib/examples/pylab/figtext.py
trunk/matplotlib/examples/pylab/fill_between.py
trunk/matplotlib/examples/pylab/fill_between_posneg.py
trunk/matplotlib/examples/pylab/fill_demo.py
trunk/matplotlib/examples/pylab/fill_demo2.py
trunk/matplotlib/examples/pylab/fill_spiral.py
trunk/matplotlib/examples/pylab/finance_demo.py
trunk/matplotlib/examples/pylab/font_table_ttf.py
trunk/matplotlib/examples/pylab/fonts_demo.py
trunk/matplotlib/examples/pylab/fonts_demo_kw.py
trunk/matplotlib/examples/pylab/ganged_plots.py
trunk/matplotlib/examples/pylab/geo_demo.py
trunk/matplotlib/examples/pylab/ginput_demo.py
trunk/matplotlib/examples/pylab/gradient_bar.py
trunk/matplotlib/examples/pylab/hatch_demo.py
trunk/matplotlib/examples/pylab/hexbin_demo.py
trunk/matplotlib/examples/pylab/hist_colormapped.py
trunk/matplotlib/examples/pylab/histogram_demo.py
trunk/matplotlib/examples/pylab/hline_demo.py
trunk/matplotlib/examples/pylab/image_demo.py
trunk/matplotlib/examples/pylab/image_demo2.py
trunk/matplotlib/examples/pylab/image_demo3.py
trunk/matplotlib/examples/pylab/image_interp.py
trunk/matplotlib/examples/pylab/image_masked.py
trunk/matplotlib/examples/pylab/image_origin.py
trunk/matplotlib/examples/pylab/image_slices_viewer.py
trunk/matplotlib/examples/pylab/integral_demo.py
trunk/matplotlib/examples/pylab/interactive.py
trunk/matplotlib/examples/pylab/interactive2.py
trunk/matplotlib/examples/pylab/interp_demo.py
trunk/matplotlib/examples/pylab/invert_axes.py
trunk/matplotlib/examples/pylab/keypress_demo.py
trunk/matplotlib/examples/pylab/layer_images.py
trunk/matplotlib/examples/pylab/legend_auto.py
trunk/matplotlib/examples/pylab/legend_demo.py
trunk/matplotlib/examples/pylab/legend_demo2.py
trunk/matplotlib/examples/pylab/legend_scatter.py
trunk/matplotlib/examples/pylab/line_collection.py
trunk/matplotlib/examples/pylab/line_collection2.py
trunk/matplotlib/examples/pylab/line_styles.py
trunk/matplotlib/examples/pylab/lineprops_dialog_gtk.py
trunk/matplotlib/examples/pylab/load_converter.py
trunk/matplotlib/examples/pylab/loadrec.py
trunk/matplotlib/examples/pylab/log_bar.py
trunk/matplotlib/examples/pylab/log_demo.py
trunk/matplotlib/examples/pylab/log_test.py
trunk/matplotlib/examples/pylab/logo.py
trunk/matplotlib/examples/pylab/major_minor_demo1.py
trunk/matplotlib/examples/pylab/major_minor_demo2.py
trunk/matplotlib/examples/pylab/manual_axis.py
trunk/matplotlib/examples/pylab/masked_demo.py
trunk/matplotlib/examples/pylab/mathtext_demo.py
trunk/matplotlib/examples/pylab/mathtext_examples.py
trunk/matplotlib/examples/pylab/matplotlib_icon.py
trunk/matplotlib/examples/pylab/matshow.py
trunk/matplotlib/examples/pylab/movie_demo.py
trunk/matplotlib/examples/pylab/mri_demo.py
trunk/matplotlib/examples/pylab/mri_with_eeg.py
trunk/matplotlib/examples/pylab/multi_image.py
trunk/matplotlib/examples/pylab/multiline.py
trunk/matplotlib/examples/pylab/multiple_figs_demo.py
trunk/matplotlib/examples/pylab/nan_test.py
trunk/matplotlib/examples/pylab/newscalarformatter_demo.py
trunk/matplotlib/examples/pylab/pcolor_demo.py
trunk/matplotlib/examples/pylab/pcolor_demo2.py
trunk/matplotlib/examples/pylab/pcolor_log.py
trunk/matplotlib/examples/pylab/pcolor_nonuniform.py
trunk/matplotlib/examples/pylab/pcolor_small.py
trunk/matplotlib/examples/pylab/pick_event_demo2.py
trunk/matplotlib/examples/pylab/pie_demo.py
trunk/matplotlib/examples/pylab/plotfile_demo.py
trunk/matplotlib/examples/pylab/polar_bar.py
trunk/matplotlib/examples/pylab/polar_demo.py
trunk/matplotlib/examples/pylab/polar_legend.py
trunk/matplotlib/examples/pylab/polar_scatter.py
trunk/matplotlib/examples/pylab/poly_editor.py
trunk/matplotlib/examples/pylab/poormans_contour.py
trunk/matplotlib/examples/pylab/print_stdout.py
trunk/matplotlib/examples/pylab/psd_demo.py
trunk/matplotlib/examples/pylab/pstest.py
trunk/matplotlib/examples/pylab/pylab_with_gtk.py
trunk/matplotlib/examples/pylab/pythonic_matplotlib.py
trunk/matplotlib/examples/pylab/quadmesh_demo.py
trunk/matplotlib/examples/pylab/quiver_demo.py
trunk/matplotlib/examples/pylab/scatter_custom_symbol.py
trunk/matplotlib/examples/pylab/scatter_demo.py
trunk/matplotlib/examples/pylab/scatter_demo2.py
trunk/matplotlib/examples/pylab/scatter_masked.py
trunk/matplotlib/examples/pylab/scatter_profile.py
trunk/matplotlib/examples/pylab/scatter_star_poly.py
trunk/matplotlib/examples/pylab/set_and_get.py
trunk/matplotlib/examples/pylab/shared_axis_across_figures.py
trunk/matplotlib/examples/pylab/shared_axis_demo.py
trunk/matplotlib/examples/pylab/simple3d.py
trunk/matplotlib/examples/pylab/simple_plot.py
trunk/matplotlib/examples/pylab/simple_plot_fps.py
trunk/matplotlib/examples/pylab/specgram_demo.py
trunk/matplotlib/examples/pylab/spy_demos.py
trunk/matplotlib/examples/pylab/stem_plot.py
trunk/matplotlib/examples/pylab/step_demo.py
trunk/matplotlib/examples/pylab/stix_fonts_demo.py
trunk/matplotlib/examples/pylab/stock_demo.py
trunk/matplotlib/examples/pylab/strip_chart_demo.py
trunk/matplotlib/examples/pylab/subplot_demo.py
trunk/matplotlib/examples/pylab/subplot_toolbar.py
trunk/matplotlib/examples/pylab/subplots_adjust.py
trunk/matplotlib/examples/pylab/symlog_demo.py
trunk/matplotlib/examples/pylab/system_monitor.py
trunk/matplotlib/examples/pylab/table_demo.py
trunk/matplotlib/examples/pylab/tex_demo.py
trunk/matplotlib/examples/pylab/tex_unicode_demo.py
trunk/matplotlib/examples/pylab/text_handles.py
trunk/matplotlib/examples/pylab/text_rotation.py
trunk/matplotlib/examples/pylab/text_themes.py
trunk/matplotlib/examples/pylab/to_numeric.py
trunk/matplotlib/examples/pylab/toggle_images.py
trunk/matplotlib/examples/pylab/transoffset.py
trunk/matplotlib/examples/pylab/two_scales.py
trunk/matplotlib/examples/pylab/unicode_demo.py
trunk/matplotlib/examples/pylab/vertical_ticklabels.py
trunk/matplotlib/examples/pylab/vline_demo.py
trunk/matplotlib/examples/pylab/webapp_demo.py
trunk/matplotlib/examples/pylab/xcorr_demo.py
trunk/matplotlib/examples/pylab/zorder_demo.py
trunk/matplotlib/examples/pyplot/
trunk/matplotlib/examples/pyplot/barchart_demo.py
trunk/matplotlib/examples/pyplot/collections_demo.py
trunk/matplotlib/examples/pyplot/colorbar_only.py
trunk/matplotlib/examples/pyplot/date_demo.py
trunk/matplotlib/examples/pyplot/scatter_piecharts.py
trunk/matplotlib/examples/tests/
trunk/matplotlib/examples/user_interfaces/
trunk/matplotlib/examples/user_interfaces/README.wx
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk.py
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk3.py
trunk/matplotlib/examples/user_interfaces/embedding_in_qt.py
trunk/matplotlib/examples/user_interfaces/embedding_in_qt4.py
trunk/matplotlib/examples/user_interfaces/embedding_in_tk.py
trunk/matplotlib/examples/user_interfaces/embedding_in_tk2.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx2.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx3.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx4.py
trunk/matplotlib/examples/user_interfaces/gtk_spreadsheet.py
trunk/matplotlib/examples/user_interfaces/histogram_demo_canvasagg.py
trunk/matplotlib/examples/user_interfaces/mathtext_wx.py
trunk/matplotlib/examples/user_interfaces/mpl_with_glade.glade
trunk/matplotlib/examples/user_interfaces/mpl_with_glade.py
trunk/matplotlib/examples/user_interfaces/printing_in_wx.py
trunk/matplotlib/examples/user_interfaces/rec_edit_gtk_custom.py
trunk/matplotlib/examples/user_interfaces/rec_edit_gtk_simple.py
trunk/matplotlib/examples/user_interfaces/simple3d_oo.py
trunk/matplotlib/examples/user_interfaces/wxcursor_demo.py
Removed Paths:
-------------
trunk/matplotlib/examples/README
trunk/matplotlib/examples/README.wx
trunk/matplotlib/examples/__init__.py
trunk/matplotlib/examples/accented_text.py
trunk/matplotlib/examples/agg_buffer_to_array.py
trunk/matplotlib/examples/agg_oo.py
trunk/matplotlib/examples/alignment_test.py
trunk/matplotlib/examples/anim.py
trunk/matplotlib/examples/animation_blit.py
trunk/matplotlib/examples/animation_blit_fltk.py
trunk/matplotlib/examples/animation_blit_qt.py
trunk/matplotlib/examples/animation_blit_qt4.py
trunk/matplotlib/examples/animation_blit_tk.py
trunk/matplotlib/examples/animation_blit_wx.py
trunk/matplotlib/examples/annotation_demo.py
trunk/matplotlib/examples/anscombe.py
trunk/matplotlib/examples/arctest.py
trunk/matplotlib/examples/arrow_demo.py
trunk/matplotlib/examples/auto_layout.py
trunk/matplotlib/examples/axes_demo.py
trunk/matplotlib/examples/axes_props.py
trunk/matplotlib/examples/axhspan_demo.py
trunk/matplotlib/examples/axis_equal_demo.py
trunk/matplotlib/examples/backend_driver.py
trunk/matplotlib/examples/bar_stacked.py
trunk/matplotlib/examples/barchart_demo.py
trunk/matplotlib/examples/barcode_demo.py
trunk/matplotlib/examples/barh_demo.py
trunk/matplotlib/examples/boxplot_demo.py
trunk/matplotlib/examples/break.py
trunk/matplotlib/examples/broken_barh.py
trunk/matplotlib/examples/clippedline.py
trunk/matplotlib/examples/cohere_demo.py
trunk/matplotlib/examples/collections_demo.py
trunk/matplotlib/examples/color_by_yvalue.py
trunk/matplotlib/examples/color_demo.py
trunk/matplotlib/examples/colorbar_only.py
trunk/matplotlib/examples/colours.py
trunk/matplotlib/examples/contour_demo.py
trunk/matplotlib/examples/contour_image.py
trunk/matplotlib/examples/contourf_demo.py
trunk/matplotlib/examples/contourf_log.py
trunk/matplotlib/examples/coords_demo.py
trunk/matplotlib/examples/coords_report.py
trunk/matplotlib/examples/csd_demo.py
trunk/matplotlib/examples/cursor_demo.py
trunk/matplotlib/examples/custom_figure_class.py
trunk/matplotlib/examples/custom_projection_example.py
trunk/matplotlib/examples/custom_scale_example.py
trunk/matplotlib/examples/custom_ticker1.py
trunk/matplotlib/examples/customize_rc.py
trunk/matplotlib/examples/dannys_example.py
trunk/matplotlib/examples/dash_control.py
trunk/matplotlib/examples/dashpointlabel.py
trunk/matplotlib/examples/dashtick.py
trunk/matplotlib/examples/data_browser.py
trunk/matplotlib/examples/data_helper.py
trunk/matplotlib/examples/date_demo.py
trunk/matplotlib/examples/date_demo1.py
trunk/matplotlib/examples/date_demo2.py
trunk/matplotlib/examples/date_demo_convert.py
trunk/matplotlib/examples/date_demo_rrule.py
trunk/matplotlib/examples/date_index_formatter.py
trunk/matplotlib/examples/dynamic_collection.py
trunk/matplotlib/examples/dynamic_demo.py
trunk/matplotlib/examples/dynamic_demo_wx.py
trunk/matplotlib/examples/dynamic_image_gtkagg.py
trunk/matplotlib/examples/dynamic_image_wxagg.py
trunk/matplotlib/examples/dynamic_image_wxagg2.py
trunk/matplotlib/examples/ellipse_demo.py
trunk/matplotlib/examples/ellipse_rotated.py
trunk/matplotlib/examples/embedding_in_gtk.py
trunk/matplotlib/examples/embedding_in_gtk2.py
trunk/matplotlib/examples/embedding_in_gtk3.py
trunk/matplotlib/examples/embedding_in_qt.py
trunk/matplotlib/examples/embedding_in_qt4.py
trunk/matplotlib/examples/embedding_in_tk.py
trunk/matplotlib/examples/embedding_in_tk2.py
trunk/matplotlib/examples/embedding_in_wx.py
trunk/matplotlib/examples/embedding_in_wx2.py
trunk/matplotlib/examples/embedding_in_wx3.py
trunk/matplotlib/examples/embedding_in_wx4.py
trunk/matplotlib/examples/equal_aspect_ratio.py
trunk/matplotlib/examples/errorbar_demo.py
trunk/matplotlib/examples/errorbar_limits.py
trunk/matplotlib/examples/figimage_demo.py
trunk/matplotlib/examples/figlegend_demo.py
trunk/matplotlib/examples/figtext.py
trunk/matplotlib/examples/fill_between.py
trunk/matplotlib/examples/fill_between_posneg.py
trunk/matplotlib/examples/fill_demo.py
trunk/matplotlib/examples/fill_demo2.py
trunk/matplotlib/examples/fill_spiral.py
trunk/matplotlib/examples/finance_demo.py
trunk/matplotlib/examples/font_indexing.py
trunk/matplotlib/examples/font_table_ttf.py
trunk/matplotlib/examples/fonts_demo.py
trunk/matplotlib/examples/fonts_demo_kw.py
trunk/matplotlib/examples/ftface_props.py
trunk/matplotlib/examples/ganged_plots.py
trunk/matplotlib/examples/geo_demo.py
trunk/matplotlib/examples/ginput_demo.py
trunk/matplotlib/examples/gradient_bar.py
trunk/matplotlib/examples/gtk_spreadsheet.py
trunk/matplotlib/examples/hatch_demo.py
trunk/matplotlib/examples/hexbin_demo.py
trunk/matplotlib/examples/hist_colormapped.py
trunk/matplotlib/examples/histogram_demo.py
trunk/matplotlib/examples/histogram_demo_canvasagg.py
trunk/matplotlib/examples/hline_demo.py
trunk/matplotlib/examples/image_demo.py
trunk/matplotlib/examples/image_demo2.py
trunk/matplotlib/examples/image_demo3.py
trunk/matplotlib/examples/image_interp.py
trunk/matplotlib/examples/image_masked.py
trunk/matplotlib/examples/image_origin.py
trunk/matplotlib/examples/image_slices_viewer.py
trunk/matplotlib/examples/integral_demo.py
trunk/matplotlib/examples/interactive.py
trunk/matplotlib/examples/interactive2.py
trunk/matplotlib/examples/interp_demo.py
trunk/matplotlib/examples/invert_axes.py
trunk/matplotlib/examples/keypress_demo.py
trunk/matplotlib/examples/lasso_demo.py
trunk/matplotlib/examples/layer_images.py
trunk/matplotlib/examples/legend_auto.py
trunk/matplotlib/examples/legend_demo.py
trunk/matplotlib/examples/legend_demo2.py
trunk/matplotlib/examples/legend_scatter.py
trunk/matplotlib/examples/line_collection.py
trunk/matplotlib/examples/line_collection2.py
trunk/matplotlib/examples/line_styles.py
trunk/matplotlib/examples/lineprops_dialog_gtk.py
trunk/matplotlib/examples/load_converter.py
trunk/matplotlib/examples/loadrec.py
trunk/matplotlib/examples/log_bar.py
trunk/matplotlib/examples/log_demo.py
trunk/matplotlib/examples/log_test.py
trunk/matplotlib/examples/logo.py
trunk/matplotlib/examples/major_minor_demo1.py
trunk/matplotlib/examples/major_minor_demo2.py
trunk/matplotlib/examples/manual_axis.py
trunk/matplotlib/examples/masked_demo.py
trunk/matplotlib/examples/mathtext_demo.py
trunk/matplotlib/examples/mathtext_examples.py
trunk/matplotlib/examples/mathtext_wx.py
trunk/matplotlib/examples/matplotlib_icon.py
trunk/matplotlib/examples/matshow.py
trunk/matplotlib/examples/movie_demo.py
trunk/matplotlib/examples/mpl_with_glade.glade
trunk/matplotlib/examples/mpl_with_glade.py
trunk/matplotlib/examples/mri_demo.py
trunk/matplotlib/examples/mri_with_eeg.py
trunk/matplotlib/examples/multi_image.py
trunk/matplotlib/examples/multiline.py
trunk/matplotlib/examples/multiple_figs_demo.py
trunk/matplotlib/examples/nan_test.py
trunk/matplotlib/examples/newscalarformatter_demo.py
trunk/matplotlib/examples/pcolor_demo.py
trunk/matplotlib/examples/pcolor_demo2.py
trunk/matplotlib/examples/pcolor_log.py
trunk/matplotlib/examples/pcolor_nonuniform.py
trunk/matplotlib/examples/pcolor_small.py
trunk/matplotlib/examples/pick_event_demo.py
trunk/matplotlib/examples/pick_event_demo2.py
trunk/matplotlib/examples/pie_demo.py
trunk/matplotlib/examples/plotfile_demo.py
trunk/matplotlib/examples/polar_bar.py
trunk/matplotlib/examples/polar_demo.py
trunk/matplotlib/examples/polar_legend.py
trunk/matplotlib/examples/polar_scatter.py
trunk/matplotlib/examples/poly_editor.py
trunk/matplotlib/examples/poormans_contour.py
trunk/matplotlib/examples/print_stdout.py
trunk/matplotlib/examples/printing_in_wx.py
trunk/matplotlib/examples/psd_demo.py
trunk/matplotlib/examples/pstest.py
trunk/matplotlib/examples/pylab_with_gtk.py
trunk/matplotlib/examples/pythonic_matplotlib.py
trunk/matplotlib/examples/quadmesh_demo.py
trunk/matplotlib/examples/quiver_demo.py
trunk/matplotlib/examples/rc_traits.py
trunk/matplotlib/examples/rec_edit_gtk_custom.py
trunk/matplotlib/examples/rec_edit_gtk_simple.py
trunk/matplotlib/examples/rec_groupby_demo.py
trunk/matplotlib/examples/rec_join_demo.py
trunk/matplotlib/examples/scatter_custom_symbol.py
trunk/matplotlib/examples/scatter_demo.py
trunk/matplotlib/examples/scatter_demo2.py
trunk/matplotlib/examples/scatter_masked.py
trunk/matplotlib/examples/scatter_piecharts.py
trunk/matplotlib/examples/scatter_profile.py
trunk/matplotlib/examples/scatter_star_poly.py
trunk/matplotlib/examples/set_and_get.py
trunk/matplotlib/examples/shared_axis_across_figures.py
trunk/matplotlib/examples/shared_axis_demo.py
trunk/matplotlib/examples/simple3d.py
trunk/matplotlib/examples/simple3d_oo.py
trunk/matplotlib/examples/simple_plot.py
trunk/matplotlib/examples/simple_plot_fps.py
trunk/matplotlib/examples/specgram_demo.py
trunk/matplotlib/examples/spy_demos.py
trunk/matplotlib/examples/stem_plot.py
trunk/matplotlib/examples/step_demo.py
trunk/matplotlib/examples/stix_fonts_demo.py
trunk/matplotlib/examples/stock_demo.py
trunk/matplotlib/examples/strip_chart_demo.py
trunk/matplotlib/examples/subplot_demo.py
trunk/matplotlib/examples/subplot_toolbar.py
trunk/matplotlib/examples/subplots_adjust.py
trunk/matplotlib/examples/symlog_demo.py
trunk/matplotlib/examples/system_monitor.py
trunk/matplotlib/examples/table_demo.py
trunk/matplotlib/examples/tex_demo.py
trunk/matplotlib/examples/tex_unicode_demo.py
trunk/matplotlib/examples/text_handles.py
trunk/matplotlib/examples/text_rotation.py
trunk/matplotlib/examples/text_themes.py
trunk/matplotlib/examples/to_numeric.py
trunk/matplotlib/examples/toggle_images.py
trunk/matplotlib/examples/transoffset.py
trunk/matplotlib/examples/two_scales.py
trunk/matplotlib/examples/unicode_demo.py
trunk/matplotlib/examples/vertical_ticklabels.py
trunk/matplotlib/examples/vline_demo.py
trunk/matplotlib/examples/webapp_demo.py
trunk/matplotlib/examples/wxcursor_demo.py
trunk/matplotlib/examples/xcorr_demo.py
trunk/matplotlib/examples/zoom_window.py
trunk/matplotlib/examples/zorder_demo.py
Deleted: trunk/matplotlib/examples/README
===================================================================
--- trunk/matplotlib/examples/README 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/README 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,24 +0,0 @@
-Here are some demos of how to use the matplotlib.
-
-
--- data_helper.py - a convenience module to load some data from the
- data dir
-
--- embedding_in_gtk - The Figure class derives from gtk.DrawingArea,
- so it is easy to embed in larger applications.
-
--- histograms_gauss.py - 2D histograms; requires the jdh.mlab module
-
--- simple_plot.py - the basic 2D line plot
-
--- subplot_demo.py - how to do multiple axes on a single plot
-
--- vline_demo.py - working with straight lines
-
--- stock_demo.py - working with large datasets. Click on the plot and
- launch the navigation tool; wheel mouse over the navigation
- buttons to scroll and zoom. There are 58 days of minute by
- minute stock quotes for two tickers. The plot lib uses
- Numeric's super speedy searchsorted routine to extract the
- clipping indices so only the data in the viewport are handled.
-
Deleted: trunk/matplotlib/examples/README.wx
===================================================================
--- trunk/matplotlib/examples/README.wx 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/README.wx 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,21 +0,0 @@
-You have a few different options available to you for embedding
-matplotlib in a wxPython application
-
-1. Embed one of the wxPython backend widgets (which subclass wx.Panel)
- directly and draw plots on it using matplotlib's object-oriented
- API. This approach is demonstrated by some of the examples
- embedding_in_wx*.py
-
-2. Embed the PlotPanel from Matt Newville's `MPlot' package and draw
- plots on it using its plot() and oplot() methods.
-
- http://cars9.uchicago.edu/~newville/Python/MPlot/
-
-3. Embed the PlotPanel from Ken McIvor wxmpl module and draw plots on
- it using the matplotlib's object-oriented API.
-
- http://agni.phys.iit.edu/~kmcivor/wxmpl/
-
-Each of these approachs has different benefits and drawbacks, so I
-encourage you to evaluate each of them and select the one that best
-meets your needs.
Deleted: trunk/matplotlib/examples/__init__.py
===================================================================
Deleted: trunk/matplotlib/examples/accented_text.py
===================================================================
--- trunk/matplotlib/examples/accented_text.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/accented_text.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-"""
-matplotlib supports accented characters via TeX mathtext
-
-The following accents are provided: \hat, \breve, \grave, \bar,
-\acute, \tilde, \vec, \dot, \ddot. All of them have the same syntax,
-eg to make an overbar you do \bar{o} or to make an o umlaut you do
-\ddot{o}. The shortcuts are also provided, eg: \"o \'e \`e \~n \.x
-\^y
-
-"""
-from pylab import *
-
-plot(range(10))
-
-title(r'$\ddot{o}\acute{e}\grave{e}\hat{O}\breve{i}\bar{A}\tilde{n}\vec{q}$', fontsize=20)
-# shorthand is also supported and curly's are optional
-xlabel(r"""$\"o\ddot o \'e\`e\~n\.x\^y$""", fontsize=20)
-
-
-show()
Deleted: trunk/matplotlib/examples/agg_buffer_to_array.py
===================================================================
--- trunk/matplotlib/examples/agg_buffer_to_array.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/agg_buffer_to_array.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,24 +0,0 @@
-import matplotlib
-matplotlib.use('Agg')
-from pylab import figure, show
-import numpy as npy
-
-# make an agg figure
-fig = figure()
-ax = fig.add_subplot(111)
-ax.plot([1,2,3])
-ax.set_title('a simple figure')
-fig.canvas.draw()
-
-# grab rhe pixel buffer and dumpy it into a numpy array
-buf = fig.canvas.buffer_rgba(0,0)
-l, b, w, h = fig.bbox.bounds
-X = npy.fromstring(buf, npy.uint8)
-X.shape = h,w,4
-
-# now display the array X as an Axes in a new figure
-fig2 = figure()
-ax2 = fig2.add_subplot(111, frameon=False)
-ax2.imshow(X)
-fig2.savefig('simple.png')
-show()
Deleted: trunk/matplotlib/examples/agg_oo.py
===================================================================
--- trunk/matplotlib/examples/agg_oo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/agg_oo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-"""
-A pure OO (look Ma, no pylab!) example using the agg backend
-"""
-from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
-from matplotlib.figure import Figure
-
-fig = Figure()
-canvas = FigureCanvas(fig)
-ax = fig.add_subplot(111)
-ax.plot([1,2,3])
-ax.set_title('hi mom')
-ax.grid(True)
-ax.set_xlabel('time')
-ax.set_ylabel('volts')
-canvas.print_figure('test')
Deleted: trunk/matplotlib/examples/alignment_test.py
===================================================================
--- trunk/matplotlib/examples/alignment_test.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/alignment_test.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-"""
-You can precisely layout text in data or axes (0,1) coordinates. This
-example shows you some of the alignment and rotation specifications to
-layout text
-"""
-
-from pylab import *
-from matplotlib.lines import Line2D
-from matplotlib.patches import Rectangle
-
-# build a rectangle in axes coords
-left, width = .25, .5
-bottom, height = .25, .5
-right = left + width
-top = bottom + height
-ax = gca()
-p = Rectangle((left, bottom), width, height,
- fill=False,
- )
-p.set_transform(ax.transAxes)
-p.set_clip_on(False)
-ax.add_patch(p)
-
-
-ax.text(left, bottom, 'left top',
- horizontalalignment='left',
- verticalalignment='top',
- transform=ax.transAxes)
-
-ax.text(left, bottom, 'left bottom',
- horizontalalignment='left',
- verticalalignment='bottom',
- transform=ax.transAxes)
-
-ax.text(right, top, 'right bottom',
- horizontalalignment='right',
- verticalalignment='bottom',
- transform=ax.transAxes)
-
-ax.text(right, top, 'right top',
- horizontalalignment='right',
- verticalalignment='top',
- transform=ax.transAxes)
-
-ax.text(right, bottom, 'center top',
- horizontalalignment='center',
- verticalalignment='top',
- transform=ax.transAxes)
-
-ax.text(left, 0.5*(bottom+top), 'right center',
- horizontalalignment='right',
- verticalalignment='center',
- rotation='vertical',
- transform=ax.transAxes)
-
-ax.text(left, 0.5*(bottom+top), 'left center',
- horizontalalignment='left',
- verticalalignment='center',
- rotation='vertical',
- transform=ax.transAxes)
-
-ax.text(0.5*(left+right), 0.5*(bottom+top), 'middle',
- horizontalalignment='center',
- verticalalignment='center',
- transform=ax.transAxes)
-
-ax.text(right, 0.5*(bottom+top), 'centered',
- horizontalalignment='center',
- verticalalignment='center',
- rotation='vertical',
- transform=ax.transAxes)
-
-ax.text(left, top, 'rotated\nwith newlines',
- horizontalalignment='center',
- verticalalignment='center',
- rotation=45,
- transform=ax.transAxes)
-
-axis('off')
-#savefig('alignment_test', dpi=100)
-show()
Deleted: trunk/matplotlib/examples/anim.py
===================================================================
--- trunk/matplotlib/examples/anim.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/anim.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-"""
-A simple example of an animated plot in matplotlib. You can test the
-speed of animation of various backends by running the script with the
-'-dSomeBackend' flag
-
-SC Aug 31 2005 mpl 0.83.2:
-Here are some numbers from my system, where FPS is the frames rendered
-per second
-
- GTK 29 FPS
- GTKAgg 18 FPS
- GTKCairo 15 FPS
- TkAgg 13 FPS
- QkAgg 13 FPS
-"""
-import time
-
-import pylab as p
-
-# turn interactive mode on for dynamic updates. If you aren't in
-# interactive mode, you'll need to use a GUI event handler/timer.
-p.ion()
-
-tstart = time.time() # for profiling
-x = p.arange(0, 2*p.pi, 0.01) # x-array
-line, = p.plot(x, p.sin(x))
-for i in p.arange(1,200):
- line.set_ydata(p.sin(x+i/10.0)) # update the data
- p.draw() # redraw the canvas
-
-print 'FPS:' , 200/(time.time()-tstart)
Copied: trunk/matplotlib/examples/animation/animation_blit.py (from rev 5143, trunk/matplotlib/examples/animation_blit.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+# For detailed comments on animation and the techniques used here, see
+# the wiki entry
+# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
+import sys
+import time
+
+import gtk, gobject
+
+import matplotlib
+matplotlib.use('GTKAgg')
+import numpy as npy
+import pylab as p
+
+
+ax = p.subplot(111)
+canvas = ax.figure.canvas
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+# create the initial line
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True, lw=2)
+
+# for profiling
+tstart = time.time()
+
+def update_line(*args):
+ if update_line.background is None:
+ update_line.background = canvas.copy_from_bbox(ax.bbox)
+
+ # restore the clean slate background
+ canvas.restore_region(update_line.background)
+ # update the data
+ line.set_ydata(npy.sin(x+update_line.cnt/10.0))
+ # just draw the animated artist
+ try:
+ ax.draw_artist(line)
+ except AssertionError:
+ return
+ # just redraw the axes rectangle
+ canvas.blit(ax.bbox)
+
+ if update_line.cnt==1000:
+ # print the timing info and quit
+ print 'FPS:' , 1000/(time.time()-tstart)
+ sys.exit()
+
+ update_line.cnt += 1
+ return True
+
+update_line.cnt = 0
+update_line.background = None
+gobject.idle_add(update_line)
+p.show()
Copied: trunk/matplotlib/examples/animation/animation_blit_fltk.py (from rev 5143, trunk/matplotlib/examples/animation_blit_fltk.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_fltk.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_fltk.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,54 @@
+import sys
+import fltk
+import matplotlib
+matplotlib.use('FltkAgg')
+import pylab as p
+import numpy as npy
+import time
+
+
+# save the clean slate background -- everything but the animated line
+# is drawn and saved in the pixel buffer background
+class animator:
+ def __init__(self,ax):
+ self.ax=ax
+ self.canvas=ax.figure.canvas
+ self.canvas.mpl_connect('draw_event',self.clear)
+ self.cnt=0
+ self.background=None
+
+ # for profiling
+ self.tstart = time.time()
+
+ def clear(self,event):
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ def update(self,ptr):
+ # restore the clean slate background
+ if self.background is None:
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+ self.canvas.restore_region(self.background)
+ # update the data
+ line.set_ydata(npy.sin(x+self.cnt/10.0))
+ # just draw the animated artist
+ self.ax.draw_artist(line)
+ # just redraw the axes rectangle
+ self.canvas.blit(ax.bbox)
+ self.cnt+=1
+ if self.cnt==1000:
+ # print the timing info and quit
+ print 'FPS:' , 1000/(time.time()-self.tstart)
+ sys.exit()
+ return True
+
+ax = p.subplot(111)
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+# create the initial line
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True)
+p.draw()
+anim=animator(ax)
+
+fltk.Fl.add_idle(anim.update)
+fltk.Fl.run()
Copied: trunk/matplotlib/examples/animation/animation_blit_qt.py (from rev 5143, trunk/matplotlib/examples/animation_blit_qt.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_qt.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_qt.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,64 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
+
+import os, sys
+import matplotlib
+matplotlib.use('QtAgg') # qt3 example
+
+from qt import *
+# Note: color-intensive applications may require a different color allocation
+# strategy.
+QApplication.setColorSpec(QApplication.NormalColor)
+
+TRUE = 1
+FALSE = 0
+ITERS = 1000
+
+import pylab as p
+import numpy as npy
+import time
+
+class BlitQT(QObject):
+ def __init__(self):
+ QObject.__init__(self, None, "app")
+
+ self.ax = p.subplot(111)
+ self.canvas = self.ax.figure.canvas
+ self.cnt = 0
+
+ # create the initial line
+ self.x = npy.arange(0,2*npy.pi,0.01)
+ self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2)
+
+ self.background = None
+
+ def timerEvent(self, evt):
+ if self.background is None:
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ # restore the clean slate background
+ self.canvas.restore_region(self.background)
+ # update the data
+ self.line.set_ydata(npy.sin(self.x+self.cnt/10.0))
+ # just draw the animated artist
+ self.ax.draw_artist(self.line)
+ # just redraw the axes rectangle
+ self.canvas.blit(self.ax.bbox)
+
+ if self.cnt==ITERS:
+ # print the timing info and quit
+ print 'FPS:' , ITERS/(time.time()-self.tstart)
+ sys.exit()
+
+ else:
+ self.cnt += 1
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+app = BlitQT()
+# for profiling
+app.tstart = time.time()
+app.startTimer(0)
+
+p.show()
Copied: trunk/matplotlib/examples/animation/animation_blit_qt4.py (from rev 5143, trunk/matplotlib/examples/animation_blit_qt4.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_qt4.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_qt4.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,68 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
+
+import os, sys
+import matplotlib
+matplotlib.use('Qt4Agg') # qt4 example
+
+from PyQt4 import QtCore, QtGui
+
+ITERS = 1000
+
+import pylab as p
+import numpy as npy
+import time
+
+class BlitQT(QtCore.QObject):
+ def __init__(self):
+ self.ax = p.subplot(111)
+ self.canvas = self.ax.figure.canvas
+
+ # By making this a child of the canvas we make sure that it is
+ # destroyed first and avoids a possible exception when the user clicks
+ # on the window's close box.
+ QtCore.QObject.__init__(self, self.canvas)
+
+ self.cnt = 0
+
+ # create the initial line
+ self.x = npy.arange(0,2*npy.pi,0.01)
+ self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2)
+
+ self.background = None
+ self.old_size = 0, 0
+
+ def timerEvent(self, evt):
+ # See if the size has changed since last time round.
+ current_size = self.ax.bbox.width, self.ax.bbox.height
+
+ if self.old_size != current_size:
+ self.old_size = current_size
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ # restore the clean slate background
+ self.canvas.restore_region(self.background)
+ # update the data
+ self.line.set_ydata(npy.sin(self.x+self.cnt/10.0))
+ # just draw the animated artist
+ self.ax.draw_artist(self.line)
+ # just redraw the axes rectangle
+ self.canvas.blit(self.ax.bbox)
+
+ if self.cnt==ITERS:
+ # print the timing info and quit
+ print 'FPS:' , ITERS/(time.time()-self.tstart)
+ sys.exit()
+
+ else:
+ self.cnt += 1
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+app = BlitQT()
+# for profiling
+app.tstart = time.time()
+app.startTimer(0)
+
+p.show()
Copied: trunk/matplotlib/examples/animation/animation_blit_tk.py (from rev 5143, trunk/matplotlib/examples/animation_blit_tk.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_tk.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_tk.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,52 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
+
+import matplotlib
+matplotlib.use('TkAgg')
+
+import sys
+import pylab as p
+import numpy as npy
+import time
+
+ax = p.subplot(111)
+canvas = ax.figure.canvas
+
+
+# create the initial line
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True, lw=2)
+
+def run(*args):
+ background = canvas.copy_from_bbox(ax.bbox)
+ # for profiling
+ tstart = time.time()
+
+ while 1:
+ # restore the clean slate background
+ canvas.restore_region(background)
+ # update the data
+ line.set_ydata(npy.sin(x+run.cnt/10.0))
+ # just draw the animated artist
+ ax.draw_artist(line)
+ # just redraw the axes rectangle
+ canvas.blit(ax.bbox)
+
+ if run.cnt==1000:
+ # print the timing info and quit
+ print 'FPS:' , 1000/(time.time()-tstart)
+ sys.exit()
+
+ run.cnt += 1
+run.cnt = 0
+
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+manager = p.get_current_fig_manager()
+manager.window.after(100, run)
+
+p.show()
+
+
+
Copied: trunk/matplotlib/examples/animation/animation_blit_wx.py (from rev 5143, trunk/matplotlib/examples/animation_blit_wx.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_wx.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_wx.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,76 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry
+# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
+
+# The number of blits() to make before exiting
+NBLITS = 1000
+
+import matplotlib
+matplotlib.use('WXAgg')
+matplotlib.rcParams['toolbar'] = 'None'
+
+import wx
+import sys
+import pylab as p
+import numpy as npy
+import time
+
+
+# allow the user to disable the WXAgg accelerator from the command line
+if '--no-accel' in sys.argv:
+ import matplotlib.backends.backend_wxagg
+ matplotlib.backends.backend_wxagg._use_accelerator(False)
+
+
+ax = p.subplot(111)
+canvas = ax.figure.canvas
+
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+# create the initial line
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True, lw=2)
+
+# for profiling
+tstart = time.time()
+blit_time = 0.0
+
+def update_line(*args):
+ global blit_time
+
+ if update_line.background is None:
+ update_line.background = canvas.copy_from_bbox(ax.bbox)
+
+ # restore the clean slate background
+ canvas.restore_region(update_line.background)
+ # update the data
+ line.set_ydata(npy.sin(x+update_line.cnt/10.0))
+ # just draw the animated artist
+ ax.draw_artist(line)
+ # just redraw the axes rectangle
+
+ t = time.time()
+ canvas.blit(ax.bbox)
+ blit_time += time.time() - t
+
+ if update_line.cnt == NBLITS:
+ # print the timing info and quit
+ frame_time = time.time() - tstart
+ print '%d frames: %.2f seconds' % (NBLITS, frame_time)
+ print '%d blits: %.2f seconds' % (NBLITS, blit_time)
+ print
+ print 'FPS: %.2f' % (NBLITS/frame_time)
+ print 'BPS: %.2f' % (NBLITS/blit_time)
+ sys.exit()
+
+ update_line.cnt += 1
+ wx.WakeUpIdle()
+
+
+
+update_line.cnt = 0
+update_line.background = None
+wx.EVT_IDLE(wx.GetApp(), update_line)
+p.show()
Copied: trunk/matplotlib/examples/animation/dynamic_collection.py (from rev 5143, trunk/matplotlib/examples/dynamic_collection.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_collection.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_collection.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,48 @@
+import random
+from matplotlib.collections import RegularPolyCollection
+import matplotlib.cm as cm
+from matplotlib.pyplot import figure, show
+from numpy.random import rand
+
+fig = figure()
+ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
+ax.set_title("Press 'a' to add a point, 'd' to delete one")
+# a single point
+offsets = [(0.5,0.5)]
+facecolors = [cm.jet(0.5)]
+
+collection = RegularPolyCollection(
+ #fig.dpi,
+ 5, # a pentagon
+ rotation=0,
+ sizes=(50,),
+ facecolors = facecolors,
+ edgecolors = 'black',
+ linewidths = (1,),
+ offsets = offsets,
+ transOffset = ax.transData,
+ )
+
+ax.add_collection(collection)
+
+def onpress(event):
+ """
+ press 'a' to add a random point from the collection, 'd' to delete one
+ """
+ if event.key=='a':
+ x,y = rand(2)
+ color = cm.jet(rand())
+ offsets.append((x,y))
+ facecolors.append(color)
+ fig.canvas.draw()
+ elif event.key=='d':
+ N = len(offsets)
+ if N>0:
+ ind = random.randint(0,N-1)
+ offsets.pop(ind)
+ facecolors.pop(ind)
+ fig.canvas.draw()
+
+fig.canvas.mpl_connect('key_press_event', onpress)
+
+show()
Copied: trunk/matplotlib/examples/animation/dynamic_demo_wx.py (from rev 5143, trunk/matplotlib/examples/dynamic_demo_wx.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_demo_wx.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_demo_wx.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+"""
+Copyright (C) Jeremy O'Donoghue, 2003
+
+License: This work is licensed under the PSF. A copy should be included
+with this source code, and is also available at
+http://www.python.org/psf/license.html
+
+This is a sample showing how to embed a matplotlib figure in a wxPanel,
+and update the contents whenever a timer event occurs. It is inspired
+by the GTK script dynamic_demo.py, by John Hunter (should be supplied with
+this file) but I have assumed that you may wish to embed a figure inside
+your own arbitrary frame, which makes the code slightly more complicated.
+
+It goes without saying that you can update the display on any event, not
+just a timer...
+
+Should you require a toolbar and navigation, inspire yourself from
+embedding_in_wx.py, which provides these features.
+
+Modification History:
+$Log$
+Revision 1.7 2005/06/15 20:24:56 jdh2358
+syncing for 82
+
+Revision 1.6 2004/10/26 18:08:13 astraw
+Converted to use new NavigationToolbar2 (from old Toolbar).
+
+Revision 1.5 2004/06/26 06:37:20 astraw
+Trivial bugfix to eliminate IndexError
+
+Revision 1.4 2004/05/03 12:12:26 jdh2358
+added bang header to examples
+
+Revision 1.3 2004/03/08 22:17:20 jdh2358
+
+* Fixed embedding_in_wx and dynamic_demo_wx examples
+
+* Ported build to darwin
+
+* Tk:
+
+ removed default figman=None from nav toolbar since it needs the
+ figman
+
+ fixed close bug
+
+ small changes to aid darwin build
+
+Revision 1.2 2004/02/26 20:22:58 jaytmiller
+Added the "numerix" Numeric/numarray selector module enabling matplotlib
+to work with either numarray or Numeric. See matplotlib.numerix.__doc__.
+
+Revision 1.1 2003/12/30 17:22:09 jodonoghue
+First version of dynamic_demo for backend_wx
+"""
+
+
+import matplotlib
+matplotlib.use('WX')
+from matplotlib.backends.backend_wx import FigureCanvasWx,\
+ FigureManager, NavigationToolbar2Wx
+
+from matplotlib.figure import Figure
+import numpy
+from wx import *
+
+
+TIMER_ID = NewId()
+
+class PlotFigure(Frame):
+
+ def __init__(self):
+ Frame.__init__(self, None, -1, "Test embedded wxFigure")
+
+ self.fig = Figure((5,4), 75)
+ self.canvas = FigureCanvasWx(self, -1, self.fig)
+ self.toolbar = NavigationToolbar2Wx(self.canvas)
+ self.toolbar.Realize()
+
+ # On Windows, default frame size behaviour is incorrect
+ # you don't need this under Linux
+ tw, th = self.toolbar.GetSizeTuple()
+ fw, fh = self.canvas.GetSizeTuple()
+ self.toolbar.SetSize(Size(fw, th))
+
+ # Create a figure manager to manage things
+ self.figmgr = FigureManager(self.canvas, 1, self)
+ # Now put all into a sizer
+ sizer = BoxSizer(VERTICAL)
+ # This way of adding to sizer allows resizing
+ sizer.Add(self.canvas, 1, LEFT|TOP|GROW)
+ # Best to allow the toolbar to resize!
+ sizer.Add(self.toolbar, 0, GROW)
+ self.SetSizer(sizer)
+ self.Fit()
+ EVT_TIMER(self, TIMER_ID, self.onTimer)
+
+ def init_plot_data(self):
+ a = self.fig.add_subplot(111)
+ self.ind = numpy.arange(60)
+ tmp = []
+ for i in range(60):
+ tmp.append(numpy.sin((self.ind+i)*numpy.pi/15))
+ self.X = numpy.array(tmp)
+ self.lines = a.plot(self.X[:,0],'o')
+ self.count = 0
+
+ def GetToolBar(self):
+ # You will need to override GetToolBar if you are using an
+ # unmanaged toolbar in your frame
+ return self.toolbar
+
+ def onTimer(self, evt):
+ self.count += 1
+ if self.count >= 60: self.count = 0
+ self.lines[0].set_data(self.ind, self.X[:,self.count])
+ self.canvas.draw()
+ self.canvas.gui_repaint()
+
+if __name__ == '__main__':
+ app = PySimpleApp()
+ frame = PlotFigure()
+ frame.init_plot_data()
+
+ # Initialise the timer - wxPython requires this to be connected to the
+ # receivicng event handler
+ t = Timer(frame, TIMER_ID)
+ t.Start(100)
+
+ frame.Show()
+ app.MainLoop()
Copied: trunk/matplotlib/examples/animation/dynamic_image_wxagg.py (from rev 5143, trunk/matplotlib/examples/dynamic_image_wxagg.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_image_wxagg.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_image_wxagg.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+"""
+Copyright (C) 2003-2004 Jeremy O'Donoghue and others
+
+License: This work is licensed under the PSF. A copy should be included
+with this source code, and is also available at
+http://www.python.org/psf/license.html
+
+"""
+import sys, time, os, gc
+
+import matplotlib
+matplotlib.use('WXAgg')
+
+from matplotlib import rcParams
+import matplotlib.cm as cm
+
+from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
+
+from matplotlib.figure import Figure
+import numpy as npy
+import wx
+
+
+TIMER_ID = wx.NewId()
+
+class PlotFigure(wx.Frame):
+
+ def __init__(self):
+ wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")
+
+ self.fig = Figure((5,4), 75)
+ self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
+ self.toolbar = Toolbar(self.canvas)
+ self.toolbar.Realize()
+
+ # On Windows, default frame size behaviour is incorrect
+ # you don't need this under Linux
+ tw, th = self.toolbar.GetSizeTuple()
+ fw, fh = self.canvas.GetSizeTuple()
+ self.toolbar.SetSize(wx.Size(fw, th))
+
+ # Initialise the timer - wxPython requires this to be connected to
+ # the receiving event handler
+ self.t = wx.Timer(self, TIMER_ID)
+ self.t.Start(10)
+
+ # Create a figure manager to manage things
+
+ # Now put all into a sizer
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ # This way of adding to sizer allows resizing
+ sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
+ # Best to allow the toolbar to resize!
+ sizer.Add(self.toolbar, 0, wx.GROW)
+ self.SetSizer(sizer)
+ self.Fit()
+ self.Bind(wx.EVT_TIMER, self.onTimer, id=TIMER_ID)
+ self.Bind(wx.EVT_CLOSE, self.onClose)
+
+ def init_plot_data(self):
+ # jdh you can add a subplot directly from the fig rather than
+ # the fig manager
+ a = self.fig.add_subplot(111)
+ self.x = npy.arange(120.0)*2*npy.pi/120.0
+ self.x.resize((100,120))
+ self.y = npy.arange(100.0)*2*npy.pi/100.0
+ self.y.resize((120,100))
+ self.y = npy.transpose(self.y)
+ z = npy.sin(self.x) + npy.cos(self.y)
+ self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
+
+ def GetToolBar(self):
+ # You will need to override GetToolBar if you are using an
+ # unmanaged toolbar in your frame
+ return self.toolbar
+
+ def onTimer(self, evt):
+ self.x += npy.pi/15
+ self.y += npy.pi/20
+ z = npy.sin(self.x) + npy.cos(self.y)
+ self.im.set_array(z)
+ self.canvas.draw()
+ #self.canvas.gui_repaint() # jdh wxagg_draw calls this already
+
+ def onClose(self, evt):
+ self.t.Stop()
+ evt.Skip()
+
+ def onEraseBackground(self, evt):
+ # this is supposed to prevent redraw flicker on some X servers...
+ pass
+
+if __name__ == '__main__':
+ app = wx.PySimpleApp()
+ frame = PlotFigure()
+ frame.init_plot_data()
+
+ frame.Show()
+ app.MainLoop()
Copied: trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py (from rev 5143, trunk/matplotlib/examples/dynamic_image_wxagg2.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+"""
+Copyright (C) 2003-2005 Jeremy O'Donoghue and others
+
+License: This work is licensed under the PSF. A copy should be included
+with this source code, and is also available at
+http://www.python.org/psf/license.html
+
+"""
+import sys, time, os, gc
+
+import matplotlib
+matplotlib.use('WXAgg')
+
+from matplotlib import rcParams
+import numpy as npy
+
+import matplotlib.cm as cm
+
+from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
+from matplotlib.backends.backend_wx import NavigationToolbar2Wx
+
+from matplotlib.figure import Figure
+from wx import *
+
+
+TIMER_ID = NewId()
+
+class PlotFigure(Frame):
+
+ def __init__(self):
+ Frame.__init__(self, None, -1, "Test embedded wxFigure")
+
+ self.fig = Figure((5,4), 75)
+ self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
+ self.toolbar = NavigationToolbar2Wx(self.canvas)
+ self.toolbar.Realize()
+
+ # On Windows, default frame size behaviour is incorrect
+ # you don't need this under Linux
+ tw, th = self.toolbar.GetSizeTuple()
+ fw, fh = self.canvas.GetSizeTuple()
+ self.toolbar.SetSize(Size(fw, th))
+
+ # Create a figure manager to manage things
+
+ # Now put all into a sizer
+ sizer = BoxSizer(VERTICAL)
+ # This way of adding to sizer allows resizing
+ sizer.Add(self.canvas, 1, LEFT|TOP|GROW)
+ # Best to allow the toolbar to resize!
+ sizer.Add(self.toolbar, 0, GROW)
+ self.SetSizer(sizer)
+ self.Fit()
+ EVT_TIMER(self, TIMER_ID, self.onTimer)
+
+ def init_plot_data(self):
+ # jdh you can add a subplot directly from the fig rather than
+ # the fig manager
+ a = self.fig.add_axes([0.075,0.1,0.75,0.85])
+ cax = self.fig.add_axes([0.85,0.1,0.075,0.85])
+ self.x = npy.empty((120,120))
+ self.x.flat = npy.arange(120.0)*2*npy.pi/120.0
+ self.y = npy.empty((120,120))
+ self.y.flat = npy.arange(120.0)*2*npy.pi/100.0
+ self.y = npy.transpose(self.y)
+ z = npy.sin(self.x) + npy.cos(self.y)
+ self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
+ self.fig.colorbar(self.im,cax=cax,orientation='vertical')
+
+ def GetToolBar(self):
+ # You will need to override GetToolBar if you are using an
+ # unmanaged toolbar in your frame
+ return self.toolbar
+
+ def onTimer(self, evt):
+ self.x += npy.pi/15
+ self.y += npy.pi/20
+ z = npy.sin(self.x) + npy.cos(self.y)
+ self.im.set_array(z)
+ self.canvas.draw()
+ #self.canvas.gui_repaint() # jdh wxagg_draw calls this already
+
+ def onEraseBackground(self, evt):
+ # this is supposed to prevent redraw flicker on some X servers...
+ pass
+
+if __name__ == '__main__':
+ app = PySimpleApp()
+ frame = PlotFigure()
+ frame.init_plot_data()
+
+ # Initialise the timer - wxPython requires this to be connected to
+ # the receiving event handler
+ t = Timer(frame, TIMER_ID)
+ t.Start(200)
+
+ frame.Show()
+ app.MainLoop()
+
Deleted: trunk/matplotlib/examples/animation_blit.py
===================================================================
--- trunk/matplotlib/examples/animation_blit.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-
-# For detailed comments on animation and the techniques used here, see
-# the wiki entry
-# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
-import sys
-import time
-
-import gtk, gobject
-
-import matplotlib
-matplotlib.use('GTKAgg')
-import numpy as npy
-import pylab as p
-
-
-ax = p.subplot(111)
-canvas = ax.figure.canvas
-
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
-
-# create the initial line
-x = npy.arange(0,2*npy.pi,0.01)
-line, = p.plot(x, npy.sin(x), animated=True, lw=2)
-
-# for profiling
-tstart = time.time()
-
-def update_line(*args):
- if update_line.background is None:
- update_line.background = canvas.copy_from_bbox(ax.bbox)
-
- # restore the clean slate background
- canvas.restore_region(update_line.background)
- # update the data
- line.set_ydata(npy.sin(x+update_line.cnt/10.0))
- # just draw the animated artist
- try:
- ax.draw_artist(line)
- except AssertionError:
- return
- # just redraw the axes rectangle
- canvas.blit(ax.bbox)
-
- if update_line.cnt==1000:
- # print the timing info and quit
- print 'FPS:' , 1000/(time.time()-tstart)
- sys.exit()
-
- update_line.cnt += 1
- return True
-
-update_line.cnt = 0
-update_line.background = None
-gobject.idle_add(update_line)
-p.show()
Deleted: trunk/matplotlib/examples/animation_blit_fltk.py
===================================================================
--- trunk/matplotlib/examples/animation_blit_fltk.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit_fltk.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,54 +0,0 @@
-import sys
-import fltk
-import matplotlib
-matplotlib.use('FltkAgg')
-import pylab as p
-import numpy as npy
-import time
-
-
-# save the clean slate background -- everything but the animated line
-# is drawn and saved in the pixel buffer background
-class animator:
- def __init__(self,ax):
- self.ax=ax
- self.canvas=ax.figure.canvas
- self.canvas.mpl_connect('draw_event',self.clear)
- self.cnt=0
- self.background=None
-
- # for profiling
- ...
[truncated message content] |
|
From: <js...@us...> - 2008-05-16 19:20:16
|
Revision: 5150
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5150&view=rev
Author: jswhit
Date: 2008-05-16 12:20:04 -0700 (Fri, 16 May 2008)
Log Message:
-----------
convert to numpy and pyplt namespaces.
Modified Paths:
--------------
trunk/toolkits/basemap/examples/test.py
Modified: trunk/toolkits/basemap/examples/test.py
===================================================================
--- trunk/toolkits/basemap/examples/test.py 2008-05-16 17:47:51 UTC (rev 5149)
+++ trunk/toolkits/basemap/examples/test.py 2008-05-16 19:20:04 UTC (rev 5150)
@@ -4,56 +4,57 @@
# parallels/meridians
from mpl_toolkits.basemap import Basemap, shiftgrid
-from pylab import show,arange,draw,figure,load,ravel,cm,axes,\
- colorbar,title,gca,pi,meshgrid
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
import matplotlib.colors as colors
# read in topo data (on a regular lat/lon grid)
# longitudes go from 20 to 380.
-topodatin = load('etopo20data.gz')
-lonsin = load('etopo20lons.gz')
-latsin = load('etopo20lats.gz')
+topodatin = mlab.load('etopo20data.gz')
+lonsin = mlab.load('etopo20lons.gz')
+latsin = mlab.load('etopo20lats.gz')
# shift data so lons go from -180 to 180 instead of 20 to 380.
topoin,lons = shiftgrid(180.,topodatin,lonsin,start=False)
lats = latsin
print 'min/max etopo20 data:'
-print min(ravel(topoin)),max(ravel(topoin))
+print topoin.min(),topoin.max()
# create new figure
-fig=figure()
+fig=plt.figure()
# setup cylindrical equidistant map projection (global domain).
m = Basemap(llcrnrlon=-180.,llcrnrlat=-90,urcrnrlon=180.,urcrnrlat=90.,\
resolution='c',area_thresh=10000.,projection='cyl')
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map.
-im = m.imshow(topoin,cm.jet)
+im = m.imshow(topoin,plt.cm.jet)
# get axes position, add colorbar axes to right of this.
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
#m.drawcountries()
#m.drawstates()
#m.fillcontinents()
# draw parallels
delat = 30.
-circles = arange(0.,90.+delat,delat).tolist()+\
- arange(-delat,-90.-delat,-delat).tolist()
+circles = np.arange(0.,90.+delat,delat).tolist()+\
+ np.arange(-delat,-90.-delat,-delat).tolist()
m.drawparallels(circles,labels=[1,0,0,1])
# draw meridians
delon = 60.
-meridians = arange(-180,180,delon)
+meridians = np.arange(-180,180,delon)
m.drawmeridians(meridians,labels=[1,0,0,1])
-title('Cylindrical Equidistant')
+plt.title('Cylindrical Equidistant')
print 'plotting Cylindrical Equidistant example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup miller cylindrical map projection.
m = Basemap(llcrnrlon=-180.,llcrnrlat=-90,urcrnrlon=180.,urcrnrlat=90.,\
resolution='c',area_thresh=10000.,projection='mill')
@@ -62,18 +63,18 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
fig.add_axes([0.1,0.1,0.75,0.75])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
m.drawcoastlines()
# draw parallels
m.drawparallels(circles,labels=[1,1,1,1])
# draw meridians
m.drawmeridians(meridians,labels=[1,1,1,1])
-title('Miller Cylindrical',y=1.1)
+plt.title('Miller Cylindrical',y=1.1)
print 'plotting Miller Cylindrical example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup mercator map projection (-80 to +80).
m = Basemap(llcrnrlon=-180.,llcrnrlat=-80,urcrnrlon=180.,urcrnrlat=80.,\
resolution='c',area_thresh=10000.,projection='merc',\
@@ -83,7 +84,7 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
fig.add_axes([0.1,0.1,0.75,0.75])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
m.drawcoastlines()
m.drawcountries()
m.drawstates()
@@ -92,12 +93,12 @@
m.drawparallels(circles,labels=[1,1,1,1])
# draw meridians
m.drawmeridians(meridians,labels=[1,1,1,1])
-title('Mercator',y=1.1)
+plt.title('Mercator',y=1.1)
print 'plotting Mercator example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup cassini-soldner basemap.
m = Basemap(llcrnrlon=-6,llcrnrlat=49,urcrnrlon=4,urcrnrlat=59,\
resolution='l',area_thresh=1000.,projection='cass',\
@@ -107,29 +108,29 @@
nx = int((m.xmax-m.xmin)/20000.)+1; ny = int((m.ymax-m.ymin)/20000.)+1
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
# get current axis instance.
-ax = gca()
+ax = plt.gca()
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
# draw parallels
delat = 2.
-circles = arange(40.,70.,delat)
+circles = np.arange(40.,70.,delat)
m.drawparallels(circles,labels=[1,0,0,1],fontsize=10)
# draw meridians
delon = 2.
-meridians = arange(-10,10,delon)
+meridians = np.arange(-10,10,delon)
m.drawmeridians(meridians,labels=[1,0,0,1],fontsize=10)
-title('Cassini-Soldner Projection')
+plt.title('Cassini-Soldner Projection')
print 'plotting Cassini-Soldner example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup gnomonic basemap.
m = Basemap(llcrnrlon=-95.,llcrnrlat=-52,urcrnrlon=-35.,urcrnrlat=15.,\
resolution='c',area_thresh=10000.,projection='gnom',\
@@ -139,30 +140,30 @@
nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
# get current axis instance.
-ax = gca()
+ax = plt.gca()
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
# draw parallels
delat = 20.
-circles = arange(-80.,100.,delat)
+circles = np.arange(-80.,100.,delat)
m.drawparallels(circles,labels=[1,0,0,1],fontsize=10)
# draw meridians
delon = 20.
-meridians = arange(-180,180,delon)
+meridians = np.arange(-180,180,delon)
m.drawmeridians(meridians,labels=[1,0,0,1],fontsize=10)
-title('Gnomonic Projection')
+plt.title('Gnomonic Projection')
print 'plotting Gnomonic example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup transverse mercator basemap.
m = Basemap(width=2*6370997,height=3.1*6370997,\
resolution='c',area_thresh=10000.,projection='cass',\
@@ -172,29 +173,29 @@
nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
# get current axis instance.
-ax = gca()
+ax = plt.gca()
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
# draw parallels
delat = 20.
-circles = arange(-80.,100.,delat)
+circles = np.arange(-80.,100.,delat)
m.drawparallels(circles,labels=[1,0,0,0],fontsize=10)
# draw meridians
delon = 20.
-meridians = arange(-180,180,delon)
+meridians = np.arange(-180,180,delon)
m.drawmeridians(meridians,labels=[1,0,0,0],fontsize=10)
-title('Transverse Mercator Projection')
+plt.title('Transverse Mercator Projection')
print 'plotting Transverse Mercator example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup oblique mercator basemap.
m = Basemap(height=16700000,width=12000000,
resolution='l',area_thresh=1000.,projection='omerc',\
@@ -203,27 +204,27 @@
nx = int((m.xmax-m.xmin)/20000.)+1; ny = int((m.ymax-m.ymin)/20000.)+1
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
# get current axis instance.
-ax = gca()
+ax = plt.gca()
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
m.drawstates()
# draw parallels
-m.drawparallels(arange(-80,81,20),labels=[1,0,0,0],fontsize=10)
+m.drawparallels(np.arange(-80,81,20),labels=[1,0,0,0],fontsize=10)
# draw meridians
-m.drawmeridians(arange(-180,181,30),labels=[0,0,0,1],fontsize=10)
-title('Oblique Mercator Projection')
+m.drawmeridians(np.arange(-180,181,30),labels=[0,0,0,1],fontsize=10)
+plt.title('Oblique Mercator Projection')
print 'plotting Oblique Mercator example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup polyconic basemap.
m = Basemap(llcrnrlon=-35.,llcrnrlat=-30,urcrnrlon=80.,urcrnrlat=50.,\
resolution='c',area_thresh=1000.,projection='poly',\
@@ -233,30 +234,30 @@
nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
# get current axis instance.
-ax = gca()
+ax = plt.gca()
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
# draw parallels
delat = 20.
-circles = arange(-80.,100.,delat)
+circles = np.arange(-80.,100.,delat)
m.drawparallels(circles,labels=[1,0,0,0],fontsize=10)
# draw meridians
delon = 20.
-meridians = arange(-180,180,delon)
+meridians = np.arange(-180,180,delon)
m.drawmeridians(meridians,labels=[1,0,0,1],fontsize=10)
-title('Polyconic Projection')
+plt.title('Polyconic Projection')
print 'plotting Polyconic example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup equidistant conic
m = Basemap(llcrnrlon=-90.,llcrnrlat=18,urcrnrlon=-70.,urcrnrlat=26.,\
resolution='l',area_thresh=1000.,projection='eqdc',\
@@ -266,30 +267,30 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
m.drawstates()
m.fillcontinents(color='olive')
# draw parallels
delat = 2.
-circles = arange(17,27,delat)
+circles = np.arange(17,27,delat)
m.drawparallels(circles,labels=[1,0,0,0])
# draw meridians
delon = 5.
-meridians = arange(-100,-60,delon)
+meridians = np.arange(-100,-60,delon)
m.drawmeridians(meridians,labels=[0,0,0,1])
-title('Equidistant Conic')
+plt.title('Equidistant Conic')
print 'plotting Equidistant Conic example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup lambert conformal map projection (North America).
m = Basemap(llcrnrlon=-145.5,llcrnrlat=1,urcrnrlon=-2.566,urcrnrlat=46.352,\
resolution='c',area_thresh=10000.,projection='lcc',\
@@ -299,31 +300,31 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
m.drawstates()
#m.fillcontinents()
# draw parallels
delat = 20.
-circles = arange(0.,90.+delat,delat).tolist()+\
- arange(-delat,-90.-delat,-delat).tolist()
+circles = np.arange(0.,90.+delat,delat).tolist()+\
+ np.arange(-delat,-90.-delat,-delat).tolist()
m.drawparallels(circles,labels=[1,1,0,1])
# draw meridians
delon = 30.
-meridians = arange(10.,360.,delon)
+meridians = np.arange(10.,360.,delon)
m.drawmeridians(meridians,labels=[1,1,0,1])
-title('Lambert Conformal Conic')
+plt.title('Lambert Conformal Conic')
print 'plotting Lambert Conformal example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup albers equal area map projection (Europe).
m = Basemap(llcrnrlon=-10.,llcrnrlat=20,urcrnrlon=55.,urcrnrlat=75,\
resolution='l',projection='aea',\
@@ -333,30 +334,30 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
im.set_clim(-4000.,3000.) # adjust range of colors.
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
# draw parallels
delat = 20.
-circles = arange(0.,90.+delat,delat).tolist()+\
- arange(-delat,-90.-delat,-delat).tolist()
+circles = np.arange(0.,90.+delat,delat).tolist()+\
+ np.arange(-delat,-90.-delat,-delat).tolist()
m.drawparallels(circles,labels=[1,1,1,1])
# draw meridians
delon = 30.
-meridians = arange(10.,360.,delon)
+meridians = np.arange(10.,360.,delon)
m.drawmeridians(meridians,labels=[1,1,1,1])
-title('Albers Equal Area Conic',y=1.075)
+plt.title('Albers Equal Area Conic',y=1.075)
print 'plotting Albers Equal Area example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup stereographic map projection (Southern Hemisphere).
#m = Basemap(llcrnrlon=120.,llcrnrlat=0.,urcrnrlon=-60.,urcrnrlat=0.,\
# resolution='c',area_thresh=10000.,projection='stere',\
@@ -369,12 +370,12 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
#m.fillcontinents()
@@ -382,12 +383,12 @@
m.drawparallels(circles)
# draw meridians
m.drawmeridians(meridians,labels=[1,1,1,1])
-title('Polar Stereographic',y=1.075)
+plt.title('Polar Stereographic',y=1.075)
print 'plotting Stereographic example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup lambert azimuthal map projection (Northern Hemisphere).
#m = Basemap(llcrnrlon=-150.,llcrnrlat=-18.,urcrnrlon=30.,urcrnrlat=--18.,\
# resolution='c',area_thresh=10000.,projection='laea',\
@@ -400,12 +401,12 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
m.drawstates()
@@ -414,12 +415,12 @@
m.drawparallels(circles)
# draw meridians
m.drawmeridians(meridians,labels=[1,1,1,1])
-title('Lambert Azimuthal Equal Area',y=1.075)
+plt.title('Lambert Azimuthal Equal Area',y=1.075)
print 'plotting Lambert Azimuthal example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup azimuthal equidistant map projection (Northern Hemisphere).
#m = Basemap(llcrnrlon=-150.,llcrnrlat=40.,urcrnrlon=30.,urcrnrlat=40.,\
# resolution='c',area_thresh=10000.,projection='aeqd',\
@@ -432,12 +433,12 @@
topodat = m.transform_scalar(topoin,lons,lats,nx,ny)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
m.drawcoastlines()
m.drawcountries()
m.drawstates()
@@ -446,7 +447,7 @@
m.drawparallels(circles)
# draw meridians
m.drawmeridians(meridians,labels=[1,1,1,1])
-title('Azimuthal Equidistant',y=1.075)
+plt.title('Azimuthal Equidistant',y=1.075)
print 'plotting Azimuthal Equidistant example ...'
print m.srs
@@ -454,20 +455,20 @@
# mollweide and robinson)
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of basemap ('ortho' = orthographic projection)
m = Basemap(projection='ortho',
resolution='c',area_thresh=10000.,lat_0=30,lon_0=-60)
# transform to nx x ny regularly spaced native projection grid
# nx and ny chosen to have roughly the same horizontal res as original image.
-dx = 2.*pi*m.rmajor/len(lons)
+dx = 2.*np.pi*m.rmajor/len(lons)
nx = int((m.xmax-m.xmin)/dx)+1; ny = int((m.ymax-m.ymin)/dx)+1
# interpolate to native projection grid.
# values outside of projection limb will be masked.
topo = m.transform_scalar(topoin,lons,lats,nx,ny,masked=True)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# set missing value in color pallette.
-palette = cm.jet
+palette = plt.cm.jet
palette.set_bad(ax.get_axis_bgcolor(), 0.0)
# plot image over map with imshow.
# (if contourf were used, no interpolation would be necessary
@@ -476,39 +477,39 @@
im = m.imshow(topo,palette,norm=colors.normalize(clip=False))
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
# draw parallels and meridians (labelling is
# not implemented for orthographic).
-parallels = arange(-80.,90,20.)
+parallels = np.arange(-80.,90,20.)
m.drawparallels(parallels)
-meridians = arange(0.,360.,20.)
+meridians = np.arange(0.,360.,20.)
m.drawmeridians(meridians)
# draw boundary around map region.
m.drawmapboundary()
-title('Orthographic')
+plt.title('Orthographic')
print 'plotting Orthographic example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of basemap ('geos' = geostationary projection)
m = Basemap(projection='geos',
rsphere=(6378137.00,6356752.3142),\
resolution='c',area_thresh=10000.,lon_0=0,satellite_height=35785831)
# transform to nx x ny regularly spaced native projection grid
# nx and ny chosen to have roughly the same horizontal res as original image.
-dx = 2.*pi*m.rmajor/len(lons)
+dx = 2.*np.pi*m.rmajor/len(lons)
nx = int((m.xmax-m.xmin)/dx)+1; ny = int((m.ymax-m.ymin)/dx)+1
# interpolate to native projection grid.
# values outside of projection limb will be masked.
topo = m.transform_scalar(topoin,lons,lats,nx,ny,masked=True)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# set missing value in color pallette.
-palette = cm.jet
+palette = plt.cm.jet
palette.set_bad(ax.get_axis_bgcolor(), 0.0)
# plot image over map with imshow.
# (if contourf were used, no interpolation would be necessary
@@ -517,104 +518,104 @@
im = m.imshow(topo,palette,norm=colors.normalize(clip=False))
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
# draw parallels and meridians (labelling is
# not implemented for geostationary).
-parallels = arange(-80.,90,20.)
+parallels = np.arange(-80.,90,20.)
m.drawparallels(parallels)
-meridians = arange(0.,360.,20.)
+meridians = np.arange(0.,360.,20.)
m.drawmeridians(meridians)
# draw boundary around map region.
m.drawmapboundary()
-title('Geostationary')
+plt.title('Geostationary')
print 'plotting Geostationary example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of sinusoidal ('sinu' = sinusioidal projection)
m = Basemap(projection='sinu',
resolution='c',area_thresh=10000.,lon_0=0.5*(lonsin[0]+lonsin[-1]))
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map with pcolormesh.
-x,y = m(*meshgrid(lonsin,latsin))
+x,y = m(*np.meshgrid(lonsin,latsin))
p = m.pcolormesh(x,y,topodatin,shading='flat')
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
# draw parallels and meridians
-parallels = arange(-60.,90,30.)
+parallels = np.arange(-60.,90,30.)
m.drawparallels(parallels,labels=[1,0,0,0])
-meridians = arange(0.,360.,30.)
+meridians = np.arange(0.,360.,30.)
m.drawmeridians(meridians)
# draw boundary around map region.
m.drawmapboundary()
-title('Sinusoidal')
+plt.title('Sinusoidal')
print 'plotting Sinusoidal example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of basemap ('moll' = mollweide projection)
m = Basemap(projection='moll',
resolution='c',area_thresh=10000.,lon_0=0.5*(lonsin[0]+lonsin[-1]))
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map with pcolormesh.
-x,y = m(*meshgrid(lonsin,latsin))
+x,y = m(*np.meshgrid(lonsin,latsin))
p = m.pcolormesh(x,y,topodatin,shading='flat')
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
# draw parallels and meridians
-parallels = arange(-60.,90,30.)
+parallels = np.arange(-60.,90,30.)
m.drawparallels(parallels,labels=[1,0,0,0])
-meridians = arange(0.,360.,30.)
+meridians = np.arange(0.,360.,30.)
m.drawmeridians(meridians)
# draw boundary around map region.
m.drawmapboundary()
-title('Mollweide')
+plt.title('Mollweide')
print 'plotting Mollweide example ...'
print m.srs
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of basemap ('robin' = robinson projection)
m = Basemap(projection='robin',
resolution='c',area_thresh=10000.,lon_0=0.5*(lonsin[0]+lonsin[-1]))
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map with pcolormesh.
-x,y = m(*meshgrid(lonsin,latsin))
+x,y = m(*np.meshgrid(lonsin,latsin))
p = m.pcolormesh(x,y,topodatin,shading='flat')
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes.
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
# draw parallels and meridians
-parallels = arange(-60.,90,30.)
+parallels = np.arange(-60.,90,30.)
m.drawparallels(parallels,labels=[1,0,0,0])
-meridians = arange(0.,360.,60.)
+meridians = np.arange(0.,360.,60.)
m.drawmeridians(meridians,labels=[0,0,0,1])
# draw boundary around map region.
m.drawmapboundary()
-title('Robinson')
+plt.title('Robinson')
print 'plotting Robinson example ...'
print m.srs
-show()
+plt.show()
print 'done'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-05-16 17:48:10
|
Revision: 5149
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5149&view=rev
Author: mmetz_bn
Date: 2008-05-16 10:47:51 -0700 (Fri, 16 May 2008)
Log Message:
-----------
Added elinewidth keyword arg to errorbar bases on patch by Christopher Brown
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-16 17:06:53 UTC (rev 5148)
+++ trunk/matplotlib/CHANGELOG 2008-05-16 17:47:51 UTC (rev 5149)
@@ -1,6 +1,8 @@
+2008-05-16 Added 'elinewidth' keyword arg to errorbar, based on patch
+ by Christopher Brown - MM
+
2008-05-16 Added 'cumulative' keyword arg to hist to plot cumulative
- histograms. For normed hists, this is normalized to one
- assuming equally spaced bins - MM
+ histograms. For normed hists, this is normalized to one - MM
2008-05-15 Fix Tk backend segfault on some machines - MGD
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-05-16 17:06:53 UTC (rev 5148)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-05-16 17:47:51 UTC (rev 5149)
@@ -3752,13 +3752,13 @@
def errorbar(self, x, y, yerr=None, xerr=None,
- fmt='-', ecolor=None, capsize=3,
+ fmt='-', ecolor=None, elinewidth=None, capsize=3,
barsabove=False, lolims=False, uplims=False,
xlolims=False, xuplims=False, **kwargs):
"""
ERRORBAR(x, y, yerr=None, xerr=None,
- fmt='b-', ecolor=None, capsize=3, barsabove=False,
- lolims=False, uplims=False,
+ fmt='b-', ecolor=None, elinewidth=None, capsize=3,
+ barsabove=False, lolims=False, uplims=False,
xlolims=False, xuplims=False)
Plot x versus y with error deltas in yerr and xerr.
@@ -3783,6 +3783,9 @@
ecolor is a matplotlib color arg which gives the color the
errorbar lines; if None, use the marker color.
+ elinewidth is the linewidth of the errorbar lines;
+ if None, use the linewidth.
+
capsize is the size of the error bar caps in points
barsabove, if True, will plot the errorbars above the plot symbols
@@ -3842,10 +3845,13 @@
caplines = []
lines_kw = {'label':'_nolegend_'}
- if 'linewidth' in kwargs:
- lines_kw['linewidth']=kwargs['linewidth']
- if 'lw' in kwargs:
- lines_kw['lw']=kwargs['lw']
+ if elinewidth:
+ lines_kw['linewidth'] = elinewidth
+ else:
+ if 'linewidth' in kwargs:
+ lines_kw['linewidth']=kwargs['linewidth']
+ if 'lw' in kwargs:
+ lines_kw['lw']=kwargs['lw']
if 'transform' in kwargs:
lines_kw['transform'] = kwargs['transform']
@@ -5432,8 +5438,7 @@
If normed is true, the first element of the return tuple will
be the counts normalized to form a probability density, ie,
n/(len(x)*dbin). In a probability density, the integral of
- the histogram should be one (we assume equally spaced bins);
- you can verify that with
+ the histogram should be one; you can verify that with
# trapezoidal integration of the probability density function
pdf, bins, patches = ax.hist(...)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-05-16 17:07:02
|
Revision: 5148
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5148&view=rev
Author: mmetz_bn
Date: 2008-05-16 10:06:53 -0700 (Fri, 16 May 2008)
Log Message:
-----------
do not rely on equalwidth bin assumption for cumhist; trapz doesn't work correctly with new histogram semantic
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-05-16 14:52:15 UTC (rev 5147)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-05-16 17:06:53 UTC (rev 5148)
@@ -5420,9 +5420,9 @@
bottom=None, histtype='bar', align='edge',
orientation='vertical', width=None, log=False, **kwargs):
"""
- HIST(x, bins=10, normed=False, bottom=None, histtype='bar',
- align='edge', orientation='vertical', width=None,
- log=False, **kwargs)
+ HIST(x, bins=10, normed=False, cumulative=False,
+ bottom=None, histtype='bar', align='edge',
+ orientation='vertical', width=None, log=False, **kwargs)
Compute the histogram of x. bins is either an integer number of
bins or a sequence giving the bins. x are the data to be binned.
@@ -5437,13 +5437,13 @@
# trapezoidal integration of the probability density function
pdf, bins, patches = ax.hist(...)
- print np.trapz(pdf, bins)
+ print np.sum(pdf * np.diff(bins))
- If cumulative is True then histogram is computed where each bin
+ If cumulative is True then a histogram is computed where each bin
gives the counts in that bin plus all bins for smaller values.
The last bins gives the total number of datapoints. If normed is
also True then the histogram is normalized such that the last bin
- equals one (assuming equally spaced bins).
+ equals one.
histtype = 'bar' | 'step'. The type of histogram to draw.
'bar' is a traditional bar-type histogram, 'step' generates
@@ -5469,10 +5469,10 @@
normed=bool(normed), new=True)
if cumulative:
- n = n.cumsum()
if normed:
- # normalize to 1
- n *= (bins[1]-bins[0])
+ n = (n * np.diff(bins)).cumsum()
+ else:
+ n = n.cumsum()
if histtype == 'bar':
if width is None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-05-16 14:53:01
|
Revision: 5147
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5147&view=rev
Author: mmetz_bn
Date: 2008-05-16 07:52:15 -0700 (Fri, 16 May 2008)
Log Message:
-----------
added cumulative histograms
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Added Paths:
-----------
trunk/matplotlib/examples/histogram_demo_cumulative.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-16 13:41:25 UTC (rev 5146)
+++ trunk/matplotlib/CHANGELOG 2008-05-16 14:52:15 UTC (rev 5147)
@@ -1,3 +1,7 @@
+2008-05-16 Added 'cumulative' keyword arg to hist to plot cumulative
+ histograms. For normed hists, this is normalized to one
+ assuming equally spaced bins - MM
+
2008-05-15 Fix Tk backend segfault on some machines - MGD
2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD
Added: trunk/matplotlib/examples/histogram_demo_cumulative.py
===================================================================
--- trunk/matplotlib/examples/histogram_demo_cumulative.py (rev 0)
+++ trunk/matplotlib/examples/histogram_demo_cumulative.py 2008-05-16 14:52:15 UTC (rev 5147)
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+from pylab import *
+
+mu, sigma = 100, 25
+x = mu + sigma*randn(10000)
+
+# the histogram of the data
+n, bins, patches = hist(x, 50, normed=1, histtype='step', cumulative=True)
+setp(patches, 'facecolor', 'g', 'alpha', 0.75)
+
+# add a 'best fit' line
+y = normpdf( bins, mu, sigma).cumsum()
+y /= y[-1]
+l = plot(bins, y, 'k--', linewidth=1.5)
+
+# overlay the first histogram with a second one
+# were the data has a smaller standard deviation
+mu, sigma = 100, 10
+x = mu + sigma*randn(10000)
+
+n, bins, patches = hist(x, bins=bins, normed=1, histtype='step', cumulative=True)
+setp(patches, 'facecolor', 'r', 'alpha', 0.25)
+
+# add a 'best fit' line
+y = normpdf( bins, mu, sigma).cumsum()
+y /= y[-1]
+l = plot(bins, y, 'k--', linewidth=1.5)
+
+grid(True)
+ylim(0, 1.1)
+
+#savefig('histogram_demo',dpi=72)
+show()
\ No newline at end of file
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-05-16 13:41:25 UTC (rev 5146)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-05-16 14:52:15 UTC (rev 5147)
@@ -5416,9 +5416,9 @@
#### Data analysis
- def hist(self, x, bins=10, normed=False, bottom=None, histtype='bar',
- align='edge', orientation='vertical', width=None,
- log=False, **kwargs):
+ def hist(self, x, bins=10, normed=False, cumulative=False,
+ bottom=None, histtype='bar', align='edge',
+ orientation='vertical', width=None, log=False, **kwargs):
"""
HIST(x, bins=10, normed=False, bottom=None, histtype='bar',
align='edge', orientation='vertical', width=None,
@@ -5439,6 +5439,12 @@
pdf, bins, patches = ax.hist(...)
print np.trapz(pdf, bins)
+ If cumulative is True then histogram is computed where each bin
+ gives the counts in that bin plus all bins for smaller values.
+ The last bins gives the total number of datapoints. If normed is
+ also True then the histogram is normalized such that the last bin
+ equals one (assuming equally spaced bins).
+
histtype = 'bar' | 'step'. The type of histogram to draw.
'bar' is a traditional bar-type histogram, 'step' generates
a lineplot.
@@ -5461,6 +5467,12 @@
if not self._hold: self.cla()
n, bins = np.histogram(x, bins, range=None,
normed=bool(normed), new=True)
+
+ if cumulative:
+ n = n.cumsum()
+ if normed:
+ # normalize to 1
+ n *= (bins[1]-bins[0])
if histtype == 'bar':
if width is None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-05-16 13:41:28
|
Revision: 5146
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5146&view=rev
Author: mmetz_bn
Date: 2008-05-16 06:41:25 -0700 (Fri, 16 May 2008)
Log Message:
-----------
Added an example for histograms with histtype='step'
Added Paths:
-----------
trunk/matplotlib/examples/histogram_demo_step.py
Added: trunk/matplotlib/examples/histogram_demo_step.py
===================================================================
--- trunk/matplotlib/examples/histogram_demo_step.py (rev 0)
+++ trunk/matplotlib/examples/histogram_demo_step.py 2008-05-16 13:41:25 UTC (rev 5146)
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+from pylab import *
+
+mu, sigma = 100, 15
+x = mu + sigma*randn(10000)
+
+# the histogram of the data
+n, bins, patches = hist(x, 50, normed=1, histtype='step')
+setp(patches, 'facecolor', 'g', 'alpha', 0.75)
+
+# add a 'best fit' line
+y = normpdf( bins, mu, sigma)
+l = plot(bins, y, 'k--', linewidth=1)
+
+
+# overlay the first histogram with a second one
+# were the data has a smaller standard deviation
+mu, sigma = 100, 5
+x = mu + sigma*randn(10000)
+
+n, bins, patches = hist(x, 50, normed=1, histtype='step')
+setp(patches, 'facecolor', 'r', 'alpha', 0.25)
+
+y = normpdf( bins, mu, sigma)
+l = plot(bins, y, 'k--', linewidth=1)
+
+axis([40, 160, 0, 0.09])
+grid(True)
+
+#savefig('histogram_demo',dpi=72)
+show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 13:07:34
|
Revision: 5145
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5145&view=rev
Author: jdh2358
Date: 2008-05-16 06:06:53 -0700 (Fri, 16 May 2008)
Log Message:
-----------
removed cold stoarge since this stuff lives on the maint branch
Removed Paths:
-------------
trunk/matplotlib/examples/cold_storage/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 12:50:22
|
Revision: 5144
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5144&view=rev
Author: jdh2358
Date: 2008-05-16 05:50:00 -0700 (Fri, 16 May 2008)
Log Message:
-----------
moved deprecated examples to storage
Added Paths:
-----------
trunk/matplotlib/examples/cold_storage/
trunk/matplotlib/examples/cold_storage/README
trunk/matplotlib/examples/cold_storage/agg_resize.py
trunk/matplotlib/examples/cold_storage/agg_test.py
trunk/matplotlib/examples/cold_storage/clippath_test.py
trunk/matplotlib/examples/cold_storage/glyph_to_path.py
Removed Paths:
-------------
trunk/matplotlib/examples/agg_resize.py
trunk/matplotlib/examples/agg_test.py
trunk/matplotlib/examples/clippath_test.py
trunk/matplotlib/examples/glyph_to_path.py
Deleted: trunk/matplotlib/examples/agg_resize.py
===================================================================
--- trunk/matplotlib/examples/agg_resize.py 2008-05-15 19:25:14 UTC (rev 5143)
+++ trunk/matplotlib/examples/agg_resize.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -1,7 +0,0 @@
-# test the resizing methods in the agg wrapper
-
-import matplotlib.agg as agg
-
-
-imMatrix = agg.trans_affine(1,0,0,1,0,0)
-interp = agg.span_interpolator_linear(imMatrix);
Deleted: trunk/matplotlib/examples/agg_test.py
===================================================================
--- trunk/matplotlib/examples/agg_test.py 2008-05-15 19:25:14 UTC (rev 5143)
+++ trunk/matplotlib/examples/agg_test.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -1,154 +0,0 @@
-# this example uses the agg python module directly there is no
-# documentation -- you have to know how to use the agg c++ API to use
-# it
-import matplotlib.agg as agg
-from math import pi
-
-## Define some colors
-red = agg.rgba8(255,0,0,255)
-blue = agg.rgba8(0,0,255,255)
-green = agg.rgba8(0,255,0,255)
-black = agg.rgba8(0,0,0,255)
-white = agg.rgba8(255,255,255,255)
-yellow = agg.rgba8(192,192,255,255)
-
-## Create the rendering buffer, rasterizer, etc
-width, height = 600,400
-stride = width*4
-buffer = agg.buffer(width, height, stride)
-
-rbuf = agg.rendering_buffer()
-rbuf.attachb(buffer)
-
-pf = agg.pixel_format_rgba(rbuf)
-rbase = agg.renderer_base_rgba(pf)
-rbase.clear_rgba8(blue)
-
-renderer = agg.renderer_scanline_aa_solid_rgba(rbase);
-renderer.color_rgba8( red )
-rasterizer = agg.rasterizer_scanline_aa()
-scanline = agg.scanline_p8()
-
-## A polygon path
-path = agg.path_storage()
-path.move_to(10,10)
-path.line_to(100,100)
-path.line_to(200,200)
-path.line_to(100,200)
-path.close_polygon()
-
-# stroke it
-stroke = agg.conv_stroke_path(path)
-stroke.width(3.0)
-rasterizer.add_path(stroke)
-agg.render_scanlines_rgba(rasterizer, scanline, renderer);
-
-## A curved path
-path = agg.path_storage()
-path.move_to(200,10)
-path.line_to(350,50)
-path.curve3(150,200)
-path.curve3(100,70)
-path.close_polygon()
-curve = agg.conv_curve_path(path)
-
-# fill it
-rasterizer.add_path(curve)
-renderer.color_rgba8( green )
-agg.render_scanlines_rgba(rasterizer, scanline, renderer);
-
-# and stroke it
-stroke = agg.conv_stroke_curve(curve)
-stroke.width(5.0)
-rasterizer.add_path(stroke)
-renderer.color_rgba8( yellow )
-agg.render_scanlines_rgba(rasterizer, scanline, renderer);
-
-## Transforming a path
-path = agg.path_storage()
-path.move_to(0,0)
-path.line_to(1,0)
-path.line_to(1,1)
-path.line_to(0,1)
-path.close_polygon()
-
-rotation = agg.trans_affine_rotation(pi/4)
-scaling = agg.trans_affine_scaling(30,30)
-translation = agg.trans_affine_translation(300,300)
-trans = rotation*scaling*translation
-
-transpath = agg.conv_transform_path(path, trans)
-stroke = agg.conv_stroke_transpath(transpath)
-stroke.width(2.0)
-rasterizer.add_path(stroke)
-renderer.color_rgba8( black )
-agg.render_scanlines_rgba(rasterizer, scanline, renderer);
-
-## Converting a transformed path to a curve
-path = agg.path_storage()
-path.move_to(0,0)
-path.curve3(1,0)
-path.curve3(1,1)
-path.curve3(0,1)
-path.close_polygon()
-
-rotation = agg.trans_affine_rotation(pi/4)
-scaling = agg.trans_affine_scaling(30,30)
-translation = agg.trans_affine_translation(300,250)
-trans = rotation*scaling*translation
-trans.flip_y()
-
-transpath = agg.conv_transform_path(path, trans)
-curvetrans = agg.conv_curve_trans(transpath)
-stroke = agg.conv_stroke_curvetrans(curvetrans)
-stroke.width(2.0)
-rasterizer.add_path(stroke)
-renderer.color_rgba8( white )
-agg.render_scanlines_rgba(rasterizer, scanline, renderer);
-
-if 0:
- ## Copy a rectangle from the buffer the rectangle defined by
- ## x0,y0->x1,y1 and paste it at xdest, ydest
- x0, y0 = 10, 50
- x1, y1 = 110, 190
- xdest, ydest = 350, 200
-
-
-
- widthr, heightr = x1-x0, y1-y0
- strider = widthr*4
- copybuffer = agg.buffer(widthr, heightr, strider)
-
-
- rbufcopy = agg.rendering_buffer()
- rbufcopy.attachb(copybuffer)
- pfcopy = agg.pixel_format_rgba(rbufcopy)
- rbasecopy = agg.renderer_base_rgba(pfcopy)
-
- rect = agg.rect(x0, y0, x1, y1)
- print rect.is_valid()
- rectp = agg.rectPtr(rect)
- #print dir(rbasecopy)
-
- # agg is funny about the arguments to copy from; the last 2 args are
- # dx, dy. If the src and dest buffers are the same size and you omit
- # the dx and dy args, the position of the copy in the dest buffer is
- # the same as in the src. Since our dest buffer is smaller than our
- # src buffer, we have to offset the location by -x0, -y0
- rbasecopy.copy_from(rbuf, rect, -x0, -y0);
-
- # paste the rectangle at a new location xdest, ydest
- rbase.copy_from(rbufcopy, None, xdest, ydest);
-
-
-
-## Display it with PIL
-s = buffer.to_string()
-print len(s)
-import Image
-im = Image.fromstring( "RGBA", (width, height), s)
-im.show()
-
-
-
-
Deleted: trunk/matplotlib/examples/clippath_test.py
===================================================================
--- trunk/matplotlib/examples/clippath_test.py 2008-05-15 19:25:14 UTC (rev 5143)
+++ trunk/matplotlib/examples/clippath_test.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -1,56 +0,0 @@
-from matplotlib.pyplot import figure, show
-import matplotlib.transforms as transforms
-from matplotlib.patches import RegularPolygon
-import matplotlib.agg as agg
-from numpy import arange, sin, pi
-from numpy.random import rand
-
-class ClipWindow:
- def __init__(self, ax, line):
- self.ax = ax
- ax.set_title('drag polygon around to test clipping')
- self.canvas = ax.figure.canvas
- self.line = line
- self.poly = RegularPolygon(
- (200, 200), numVertices=10, radius=100,
- facecolor='yellow', alpha=0.25,
- transform=transforms.IdentityTransform())
-
- ax.add_patch(self.poly)
- self.canvas.mpl_connect('button_press_event', self.onpress)
- self.canvas.mpl_connect('button_release_event', self.onrelease)
- self.canvas.mpl_connect('motion_notify_event', self.onmove)
- self.x, self.y = None, None
-
- def onpress(self, event):
- self.x, self.y = event.x, event.y
-
- def onrelease(self, event):
- self.x, self.y = None, None
-
- def onmove(self, event):
-
- if self.x is None: return
- dx = event.x - self.x
- dy = event.y - self.y
- self.x, self.y = event.x, event.y
- x, y = self.poly.xy
- x += dx
- y += dy
- #print self.y, event.y, dy, y
- self.poly.xy = x,y
- self._clip()
-
- def _clip(self):
- self.line.set_clip_path(self.poly.get_path(), self.poly.get_transform())
- self.canvas.draw_idle()
-
-
-fig = figure(figsize=(8,8))
-ax = fig.add_subplot(111)
-t = arange(0.0, 4.0, 0.01)
-s = 2*sin(2*pi*8*t)
-
-line, = ax.plot(t, 2*(rand(len(t))-0.5), 'b-')
-clipwin = ClipWindow(ax, line)
-show()
Added: trunk/matplotlib/examples/cold_storage/README
===================================================================
--- trunk/matplotlib/examples/cold_storage/README (rev 0)
+++ trunk/matplotlib/examples/cold_storage/README 2008-05-16 12:50:00 UTC (rev 5144)
@@ -0,0 +1,4 @@
+These are old examples that are now derecated and most likely
+non-functional but we are keeping them around in case we want to
+resurrect them on day. You can safely ignore them.
+
Copied: trunk/matplotlib/examples/cold_storage/agg_resize.py (from rev 5143, trunk/matplotlib/examples/agg_resize.py)
===================================================================
--- trunk/matplotlib/examples/cold_storage/agg_resize.py (rev 0)
+++ trunk/matplotlib/examples/cold_storage/agg_resize.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -0,0 +1,7 @@
+# test the resizing methods in the agg wrapper
+
+import matplotlib.agg as agg
+
+
+imMatrix = agg.trans_affine(1,0,0,1,0,0)
+interp = agg.span_interpolator_linear(imMatrix);
Copied: trunk/matplotlib/examples/cold_storage/agg_test.py (from rev 5143, trunk/matplotlib/examples/agg_test.py)
===================================================================
--- trunk/matplotlib/examples/cold_storage/agg_test.py (rev 0)
+++ trunk/matplotlib/examples/cold_storage/agg_test.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -0,0 +1,154 @@
+# this example uses the agg python module directly there is no
+# documentation -- you have to know how to use the agg c++ API to use
+# it
+import matplotlib.agg as agg
+from math import pi
+
+## Define some colors
+red = agg.rgba8(255,0,0,255)
+blue = agg.rgba8(0,0,255,255)
+green = agg.rgba8(0,255,0,255)
+black = agg.rgba8(0,0,0,255)
+white = agg.rgba8(255,255,255,255)
+yellow = agg.rgba8(192,192,255,255)
+
+## Create the rendering buffer, rasterizer, etc
+width, height = 600,400
+stride = width*4
+buffer = agg.buffer(width, height, stride)
+
+rbuf = agg.rendering_buffer()
+rbuf.attachb(buffer)
+
+pf = agg.pixel_format_rgba(rbuf)
+rbase = agg.renderer_base_rgba(pf)
+rbase.clear_rgba8(blue)
+
+renderer = agg.renderer_scanline_aa_solid_rgba(rbase);
+renderer.color_rgba8( red )
+rasterizer = agg.rasterizer_scanline_aa()
+scanline = agg.scanline_p8()
+
+## A polygon path
+path = agg.path_storage()
+path.move_to(10,10)
+path.line_to(100,100)
+path.line_to(200,200)
+path.line_to(100,200)
+path.close_polygon()
+
+# stroke it
+stroke = agg.conv_stroke_path(path)
+stroke.width(3.0)
+rasterizer.add_path(stroke)
+agg.render_scanlines_rgba(rasterizer, scanline, renderer);
+
+## A curved path
+path = agg.path_storage()
+path.move_to(200,10)
+path.line_to(350,50)
+path.curve3(150,200)
+path.curve3(100,70)
+path.close_polygon()
+curve = agg.conv_curve_path(path)
+
+# fill it
+rasterizer.add_path(curve)
+renderer.color_rgba8( green )
+agg.render_scanlines_rgba(rasterizer, scanline, renderer);
+
+# and stroke it
+stroke = agg.conv_stroke_curve(curve)
+stroke.width(5.0)
+rasterizer.add_path(stroke)
+renderer.color_rgba8( yellow )
+agg.render_scanlines_rgba(rasterizer, scanline, renderer);
+
+## Transforming a path
+path = agg.path_storage()
+path.move_to(0,0)
+path.line_to(1,0)
+path.line_to(1,1)
+path.line_to(0,1)
+path.close_polygon()
+
+rotation = agg.trans_affine_rotation(pi/4)
+scaling = agg.trans_affine_scaling(30,30)
+translation = agg.trans_affine_translation(300,300)
+trans = rotation*scaling*translation
+
+transpath = agg.conv_transform_path(path, trans)
+stroke = agg.conv_stroke_transpath(transpath)
+stroke.width(2.0)
+rasterizer.add_path(stroke)
+renderer.color_rgba8( black )
+agg.render_scanlines_rgba(rasterizer, scanline, renderer);
+
+## Converting a transformed path to a curve
+path = agg.path_storage()
+path.move_to(0,0)
+path.curve3(1,0)
+path.curve3(1,1)
+path.curve3(0,1)
+path.close_polygon()
+
+rotation = agg.trans_affine_rotation(pi/4)
+scaling = agg.trans_affine_scaling(30,30)
+translation = agg.trans_affine_translation(300,250)
+trans = rotation*scaling*translation
+trans.flip_y()
+
+transpath = agg.conv_transform_path(path, trans)
+curvetrans = agg.conv_curve_trans(transpath)
+stroke = agg.conv_stroke_curvetrans(curvetrans)
+stroke.width(2.0)
+rasterizer.add_path(stroke)
+renderer.color_rgba8( white )
+agg.render_scanlines_rgba(rasterizer, scanline, renderer);
+
+if 0:
+ ## Copy a rectangle from the buffer the rectangle defined by
+ ## x0,y0->x1,y1 and paste it at xdest, ydest
+ x0, y0 = 10, 50
+ x1, y1 = 110, 190
+ xdest, ydest = 350, 200
+
+
+
+ widthr, heightr = x1-x0, y1-y0
+ strider = widthr*4
+ copybuffer = agg.buffer(widthr, heightr, strider)
+
+
+ rbufcopy = agg.rendering_buffer()
+ rbufcopy.attachb(copybuffer)
+ pfcopy = agg.pixel_format_rgba(rbufcopy)
+ rbasecopy = agg.renderer_base_rgba(pfcopy)
+
+ rect = agg.rect(x0, y0, x1, y1)
+ print rect.is_valid()
+ rectp = agg.rectPtr(rect)
+ #print dir(rbasecopy)
+
+ # agg is funny about the arguments to copy from; the last 2 args are
+ # dx, dy. If the src and dest buffers are the same size and you omit
+ # the dx and dy args, the position of the copy in the dest buffer is
+ # the same as in the src. Since our dest buffer is smaller than our
+ # src buffer, we have to offset the location by -x0, -y0
+ rbasecopy.copy_from(rbuf, rect, -x0, -y0);
+
+ # paste the rectangle at a new location xdest, ydest
+ rbase.copy_from(rbufcopy, None, xdest, ydest);
+
+
+
+## Display it with PIL
+s = buffer.to_string()
+print len(s)
+import Image
+im = Image.fromstring( "RGBA", (width, height), s)
+im.show()
+
+
+
+
Copied: trunk/matplotlib/examples/cold_storage/clippath_test.py (from rev 5143, trunk/matplotlib/examples/clippath_test.py)
===================================================================
--- trunk/matplotlib/examples/cold_storage/clippath_test.py (rev 0)
+++ trunk/matplotlib/examples/cold_storage/clippath_test.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -0,0 +1,56 @@
+from matplotlib.pyplot import figure, show
+import matplotlib.transforms as transforms
+from matplotlib.patches import RegularPolygon
+import matplotlib.agg as agg
+from numpy import arange, sin, pi
+from numpy.random import rand
+
+class ClipWindow:
+ def __init__(self, ax, line):
+ self.ax = ax
+ ax.set_title('drag polygon around to test clipping')
+ self.canvas = ax.figure.canvas
+ self.line = line
+ self.poly = RegularPolygon(
+ (200, 200), numVertices=10, radius=100,
+ facecolor='yellow', alpha=0.25,
+ transform=transforms.IdentityTransform())
+
+ ax.add_patch(self.poly)
+ self.canvas.mpl_connect('button_press_event', self.onpress)
+ self.canvas.mpl_connect('button_release_event', self.onrelease)
+ self.canvas.mpl_connect('motion_notify_event', self.onmove)
+ self.x, self.y = None, None
+
+ def onpress(self, event):
+ self.x, self.y = event.x, event.y
+
+ def onrelease(self, event):
+ self.x, self.y = None, None
+
+ def onmove(self, event):
+
+ if self.x is None: return
+ dx = event.x - self.x
+ dy = event.y - self.y
+ self.x, self.y = event.x, event.y
+ x, y = self.poly.xy
+ x += dx
+ y += dy
+ #print self.y, event.y, dy, y
+ self.poly.xy = x,y
+ self._clip()
+
+ def _clip(self):
+ self.line.set_clip_path(self.poly.get_path(), self.poly.get_transform())
+ self.canvas.draw_idle()
+
+
+fig = figure(figsize=(8,8))
+ax = fig.add_subplot(111)
+t = arange(0.0, 4.0, 0.01)
+s = 2*sin(2*pi*8*t)
+
+line, = ax.plot(t, 2*(rand(len(t))-0.5), 'b-')
+clipwin = ClipWindow(ax, line)
+show()
Copied: trunk/matplotlib/examples/cold_storage/glyph_to_path.py (from rev 5143, trunk/matplotlib/examples/glyph_to_path.py)
===================================================================
--- trunk/matplotlib/examples/cold_storage/glyph_to_path.py (rev 0)
+++ trunk/matplotlib/examples/cold_storage/glyph_to_path.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -0,0 +1,84 @@
+import os
+import matplotlib
+from matplotlib.ft2font import FT2Font
+import matplotlib.agg as agg
+
+MOVETO, LINETO, CURVE3, CURVE4, ENDPOLY = range(5)
+
+def glyph_to_agg_path(glyph):
+ path = agg.path_storage()
+ for tup in glyph.path:
+ print tup
+ code = tup[0]
+ if code == MOVETO:
+ x,y = tup[1:]
+ path.move_to(x,y)
+ elif code == LINETO:
+ x,y = tup[1:]
+ path.line_to(x,y)
+ elif code == CURVE3:
+ xctl, yctl, xto, yto= tup[1:]
+ path.curve3(xctl, yctl, xto, yto)
+
+ elif code == CURVE4:
+ xctl1, yctl1, xctl2, yctl2, xto, yto= tup[1:]
+ path.curve4(xctl1, yct1, xctl2, yctl2, xto, yto)
+ elif code == ENDPOLY:
+ path.end_poly()
+
+ return path
+
+width, height = 300,300
+fname = os.path.join(matplotlib.get_data_path(), 'fonts/ttf/Vera.ttf')
+font = FT2Font(fname)
+glyph = font.load_char(ord('y'))
+path = glyph_to_agg_path(glyph)
+
+curve = agg.conv_curve_path(path)
+
+
+scaling = agg.trans_affine_scaling(20,20)
+translation = agg.trans_affine_translation(4,4)
+rotation = agg.trans_affine_rotation(3.1415926)
+mtrans = translation*scaling # cannot use this as a temporary
+tpath = agg.conv_transform_path(path, mtrans)
+
+curve = agg.conv_curve_trans(tpath)
+
+stride = width*4
+buffer = agg.buffer(width, height, stride)
+
+rbuf = agg.rendering_buffer()
+rbuf.attachb(buffer)
+
+red = agg.rgba8(255,0,0,255)
+blue = agg.rgba8(0,0,255,255)
+white = agg.rgba8(255,255,255,255)
+
+pf = agg.pixel_format_rgba(rbuf)
+rbase = agg.renderer_base_rgba(pf)
+rbase.clear_rgba8(white)
+
+renderer = agg.renderer_scanline_aa_solid_rgba(rbase);
+
+
+rasterizer = agg.rasterizer_scanline_aa()
+scanline = agg.scanline_p8()
+
+# first fill
+rasterizer.add_path(curve)
+renderer.color_rgba8(blue)
+agg.render_scanlines_rgba(rasterizer, scanline, renderer);
+
+# then stroke
+stroke = agg.conv_stroke_curvetrans(curve)
+stroke.width(2.0)
+renderer.color_rgba8( red )
+rasterizer.add_path(stroke)
+agg.render_scanlines_rgba(rasterizer, scanline, renderer);
+
+s = buffer.to_string()
+import Image
+im = Image.fromstring( "RGBA", (width, height), s)
+im.show()
+
Deleted: trunk/matplotlib/examples/glyph_to_path.py
===================================================================
--- trunk/matplotlib/examples/glyph_to_path.py 2008-05-15 19:25:14 UTC (rev 5143)
+++ trunk/matplotlib/examples/glyph_to_path.py 2008-05-16 12:50:00 UTC (rev 5144)
@@ -1,84 +0,0 @@
-import os
-import matplotlib
-from matplotlib.ft2font import FT2Font
-import matplotlib.agg as agg
-
-MOVETO, LINETO, CURVE3, CURVE4, ENDPOLY = range(5)
-
-def glyph_to_agg_path(glyph):
- path = agg.path_storage()
- for tup in glyph.path:
- print tup
- code = tup[0]
- if code == MOVETO:
- x,y = tup[1:]
- path.move_to(x,y)
- elif code == LINETO:
- x,y = tup[1:]
- path.line_to(x,y)
- elif code == CURVE3:
- xctl, yctl, xto, yto= tup[1:]
- path.curve3(xctl, yctl, xto, yto)
-
- elif code == CURVE4:
- xctl1, yctl1, xctl2, yctl2, xto, yto= tup[1:]
- path.curve4(xctl1, yct1, xctl2, yctl2, xto, yto)
- elif code == ENDPOLY:
- path.end_poly()
-
- return path
-
-width, height = 300,300
-fname = os.path.join(matplotlib.get_data_path(), 'fonts/ttf/Vera.ttf')
-font = FT2Font(fname)
-glyph = font.load_char(ord('y'))
-path = glyph_to_agg_path(glyph)
-
-curve = agg.conv_curve_path(path)
-
-
-scaling = agg.trans_affine_scaling(20,20)
-translation = agg.trans_affine_translation(4,4)
-rotation = agg.trans_affine_rotation(3.1415926)
-mtrans = translation*scaling # cannot use this as a temporary
-tpath = agg.conv_transform_path(path, mtrans)
-
-curve = agg.conv_curve_trans(tpath)
-
-stride = width*4
-buffer = agg.buffer(width, height, stride)
-
-rbuf = agg.rendering_buffer()
-rbuf.attachb(buffer)
-
-red = agg.rgba8(255,0,0,255)
-blue = agg.rgba8(0,0,255,255)
-white = agg.rgba8(255,255,255,255)
-
-pf = agg.pixel_format_rgba(rbuf)
-rbase = agg.renderer_base_rgba(pf)
-rbase.clear_rgba8(white)
-
-renderer = agg.renderer_scanline_aa_solid_rgba(rbase);
-
-
-rasterizer = agg.rasterizer_scanline_aa()
-scanline = agg.scanline_p8()
-
-# first fill
-rasterizer.add_path(curve)
-renderer.color_rgba8(blue)
-agg.render_scanlines_rgba(rasterizer, scanline, renderer);
-
-# then stroke
-stroke = agg.conv_stroke_curvetrans(curve)
-stroke.width(2.0)
-renderer.color_rgba8( red )
-rasterizer.add_path(stroke)
-agg.render_scanlines_rgba(rasterizer, scanline, renderer);
-
-s = buffer.to_string()
-import Image
-im = Image.fromstring( "RGBA", (width, height), s)
-im.show()
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-15 19:26:14
|
Revision: 5143
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5143&view=rev
Author: jdh2358
Date: 2008-05-15 12:25:14 -0700 (Thu, 15 May 2008)
Log Message:
-----------
using c++ headers for stlib and stdio for backend_agg
Modified Paths:
--------------
trunk/matplotlib/src/_tkagg.cpp
Modified: trunk/matplotlib/src/_tkagg.cpp
===================================================================
--- trunk/matplotlib/src/_tkagg.cpp 2008-05-15 19:19:43 UTC (rev 5142)
+++ trunk/matplotlib/src/_tkagg.cpp 2008-05-15 19:25:14 UTC (rev 5143)
@@ -10,8 +10,8 @@
#define USE_COMPOSITELESS_PHOTO_PUT_BLOCK
#include <Python.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
#include <sstream>
#include "agg_basics.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-15 19:19:51
|
Revision: 5142
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5142&view=rev
Author: jdh2358
Date: 2008-05-15 12:19:43 -0700 (Thu, 15 May 2008)
Log Message:
-----------
trying scanf for tcl pointer conversion
Modified Paths:
--------------
trunk/matplotlib/src/_tkagg.cpp
Modified: trunk/matplotlib/src/_tkagg.cpp
===================================================================
--- trunk/matplotlib/src/_tkagg.cpp 2008-05-15 18:54:23 UTC (rev 5141)
+++ trunk/matplotlib/src/_tkagg.cpp 2008-05-15 19:19:43 UTC (rev 5142)
@@ -11,6 +11,7 @@
#include <Python.h>
#include <stdlib.h>
+#include <stdio.h>
#include <sstream>
#include "agg_basics.h"
@@ -47,6 +48,8 @@
// vars for blitting
PyObject* bboxo;
+
+ unsigned long aggl, bboxl;
bool has_bbox;
agg::int8u *destbuffer;
double l,b,r,t;
@@ -73,10 +76,14 @@
return TCL_ERROR;
}
/* get array (or object that can be converted to array) pointer */
- std::stringstream agg_ptr_ss;
- agg_ptr_ss.str(argv[2]);
- agg_ptr_ss >> tmp_ptr;
- aggo = (PyObject*)tmp_ptr;
+ sscanf (argv[2],"%lu",&aggl);
+ aggo = (PyObject*)aggl;
+ //aggo = (PyObject*)atol(argv[2]);
+
+ //std::stringstream agg_ptr_ss;
+ //agg_ptr_ss.str(argv[2]);
+ //agg_ptr_ss >> tmp_ptr;
+ //aggo = (PyObject*)tmp_ptr;
RendererAgg *aggRenderer = (RendererAgg *)aggo;
int srcheight = (int)aggRenderer->get_height();
@@ -90,10 +97,14 @@
}
/* check for bbox/blitting */
- std::stringstream bbox_ptr_ss;
- bbox_ptr_ss.str(argv[4]);
- bbox_ptr_ss >> tmp_ptr;
- bboxo = (PyObject*)tmp_ptr;
+ sscanf (argv[4],"%lu",&bboxl);
+ bboxo = (PyObject*)bboxl;
+
+ //bboxo = (PyObject*)atol(argv[4]);
+ //std::stringstream bbox_ptr_ss;
+ //bbox_ptr_ss.str(argv[4]);
+ //bbox_ptr_ss >> tmp_ptr;
+ //bboxo = (PyObject*)tmp_ptr;
if (py_convert_bbox(bboxo, l, b, r, t)) {
has_bbox = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-15 18:54:38
|
Revision: 5141
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5141&view=rev
Author: jdh2358
Date: 2008-05-15 11:54:23 -0700 (Thu, 15 May 2008)
Log Message:
-----------
fixed a problem with axh and vline scaling
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-05-15 13:03:49 UTC (rev 5140)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-05-15 18:54:23 UTC (rev 5141)
@@ -2449,9 +2449,14 @@
%(Line2D)s
"""
+ ymin, ymax = self.get_ylim()
+ if ymax<ymin: ymin, ymax = ymax, ymin
+ scaley = (y<ymin) or (y>ymax)
+
trans = mtransforms.blended_transform_factory(
self.transAxes, self.transData)
- l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, **kwargs)
+ l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, scaley=scaley, **kwargs)
+
return l
axhline.__doc__ = cbook.dedent(axhline.__doc__) % martist.kwdocd
@@ -2486,9 +2491,14 @@
%(Line2D)s
"""
+ xmin, xmax = self.get_xlim()
+ if xmax<xmin: xmin, xmax = xmax, xmin
+ scalex = (x<xmin) or (x>xmax)
+
trans = mtransforms.blended_transform_factory(
self.transData, self.transAxes)
- l, = self.plot([x,x], [ymin,ymax] , transform=trans, scaley=False, **kwargs)
+ l, = self.plot([x,x], [ymin,ymax] , transform=trans, scalex=scalex, scaley=False, **kwargs)
+
return l
axvline.__doc__ = cbook.dedent(axvline.__doc__) % martist.kwdocd
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-15 13:03:54
|
Revision: 5140
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5140&view=rev
Author: mdboom
Date: 2008-05-15 06:03:49 -0700 (Thu, 15 May 2008)
Log Message:
-----------
Fix Tk backend segfault.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/src/_tkagg.cpp
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-14 17:28:26 UTC (rev 5139)
+++ trunk/matplotlib/CHANGELOG 2008-05-15 13:03:49 UTC (rev 5140)
@@ -1,3 +1,5 @@
+2008-05-15 Fix Tk backend segfault on some machines - MGD
+
2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD
2008-05-09 Fix /singlequote (') in Postscript backend - MGD
Modified: trunk/matplotlib/src/_tkagg.cpp
===================================================================
--- trunk/matplotlib/src/_tkagg.cpp 2008-05-14 17:28:26 UTC (rev 5139)
+++ trunk/matplotlib/src/_tkagg.cpp 2008-05-15 13:03:49 UTC (rev 5140)
@@ -11,6 +11,7 @@
#include <Python.h>
#include <stdlib.h>
+#include <sstream>
#include "agg_basics.h"
#include "_backend_agg.h"
@@ -50,6 +51,7 @@
agg::int8u *destbuffer;
double l,b,r,t;
int destx, desty, destwidth, destheight, deststride;
+ unsigned long tmp_ptr;
long mode;
long nval;
@@ -71,7 +73,10 @@
return TCL_ERROR;
}
/* get array (or object that can be converted to array) pointer */
- aggo = (PyObject*)atol(argv[2]);
+ std::stringstream agg_ptr_ss;
+ agg_ptr_ss.str(argv[2]);
+ agg_ptr_ss >> tmp_ptr;
+ aggo = (PyObject*)tmp_ptr;
RendererAgg *aggRenderer = (RendererAgg *)aggo;
int srcheight = (int)aggRenderer->get_height();
@@ -85,7 +90,10 @@
}
/* check for bbox/blitting */
- bboxo = (PyObject*)atol(argv[4]);
+ std::stringstream bbox_ptr_ss;
+ bbox_ptr_ss.str(argv[4]);
+ bbox_ptr_ss >> tmp_ptr;
+ bboxo = (PyObject*)tmp_ptr;
if (py_convert_bbox(bboxo, l, b, r, t)) {
has_bbox = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-14 17:31:11
|
Revision: 5139
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5139&view=rev
Author: jdh2358
Date: 2008-05-14 10:28:26 -0700 (Wed, 14 May 2008)
Log Message:
-----------
fixed loadrec
Modified Paths:
--------------
trunk/matplotlib/examples/loadrec.py
Modified: trunk/matplotlib/examples/loadrec.py
===================================================================
--- trunk/matplotlib/examples/loadrec.py 2008-05-14 16:39:28 UTC (rev 5138)
+++ trunk/matplotlib/examples/loadrec.py 2008-05-14 17:28:26 UTC (rev 5139)
@@ -10,5 +10,7 @@
ax.plot(a.date, a.adj_close, '-')
fig.autofmt_xdate()
-mlab.rec2excel(a, 'test.xls', colnum=4)
+# if you have pyExcelerator installed, you can output excel
+#import mpl_toolkits.exceltools as exceltools
+#exceltools.rec2excel(a, 'test.xls', colnum=4)
show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-14 16:40:44
|
Revision: 5138
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5138&view=rev
Author: mdboom
Date: 2008-05-14 09:39:28 -0700 (Wed, 14 May 2008)
Log Message:
-----------
Fix various bugs submitted by Matthias Michler:
- Parts of text.py were not updated for the new transforms
- Import/namespace errors in custom_projection_example.py,
poly_editor.py
- Fix legend_scatter.py
Modified Paths:
--------------
trunk/matplotlib/examples/custom_projection_example.py
trunk/matplotlib/examples/legend_scatter.py
trunk/matplotlib/examples/poly_editor.py
trunk/matplotlib/lib/matplotlib/legend.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/examples/custom_projection_example.py
===================================================================
--- trunk/matplotlib/examples/custom_projection_example.py 2008-05-14 13:52:22 UTC (rev 5137)
+++ trunk/matplotlib/examples/custom_projection_example.py 2008-05-14 16:39:28 UTC (rev 5138)
@@ -7,6 +7,8 @@
BboxTransformTo, IdentityTransform, Transform, TransformWrapper
from matplotlib.projections import register_projection
+import numpy as npy
+
# This example projection class is rather long, but it is designed to
# illustrate many features, not all of which will be used every time.
# It is also common to factor out a lot of these methods into common
Modified: trunk/matplotlib/examples/legend_scatter.py
===================================================================
--- trunk/matplotlib/examples/legend_scatter.py 2008-05-14 13:52:22 UTC (rev 5137)
+++ trunk/matplotlib/examples/legend_scatter.py 2008-05-14 16:39:28 UTC (rev 5138)
@@ -3,7 +3,7 @@
N=1000
-props = dict( alpha=0.5, faceted=False )
+props = dict( alpha=0.5, edgecolors='none' )
handles = []
colours = ['red', 'green', 'blue', 'magenta', 'cyan', 'yellow']
Modified: trunk/matplotlib/examples/poly_editor.py
===================================================================
--- trunk/matplotlib/examples/poly_editor.py 2008-05-14 13:52:22 UTC (rev 5137)
+++ trunk/matplotlib/examples/poly_editor.py 2008-05-14 16:39:28 UTC (rev 5138)
@@ -5,7 +5,7 @@
"""
from matplotlib.artist import Artist
from matplotlib.patches import Polygon, CirclePolygon
-from numpy import sqrt, nonzero, equal, asarray, dot, amin
+from numpy import sqrt, nonzero, equal, array, asarray, dot, amin, cos, sin
from matplotlib.mlab import dist_point_to_segment
@@ -69,7 +69,7 @@
'get the index of the vertex under point if within epsilon tolerance'
# display coords
- xy = npy.asarray(self.poly.xy)
+ xy = asarray(self.poly.xy)
xyt = self.poly.get_transform().transform(xy)
xt, yt = xyt[:, 0], xyt[:, 1]
d = sqrt((xt-event.x)**2 + (yt-event.y)**2)
@@ -114,7 +114,7 @@
s1 = xys[i+1]
d = dist_point_to_segment(p, s0, s1)
if d<=self.epsilon:
- self.poly.xy = npy.array(
+ self.poly.xy = array(
list(self.poly.xy[:i]) +
[(event.xdata, event.ydata)] +
list(self.poly.xy[i:]))
@@ -152,8 +152,8 @@
theta = arange(0, 2*pi, 0.1)
r = 1.5
-xs = r*npy.cos(theta)
-ys = r*npy.sin(theta)
+xs = r*cos(theta)
+ys = r*sin(theta)
poly = Polygon(zip(xs, ys,), animated=True)
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-05-14 13:52:22 UTC (rev 5137)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-05-14 16:39:28 UTC (rev 5138)
@@ -288,7 +288,7 @@
width = self.handlelen, height=HEIGHT/2,
)
p.set_facecolor(handle._facecolors[0])
- if handle._edgecolors != 'None':
+ if handle._edgecolors != 'none' and len(handle._edgecolors):
p.set_edgecolor(handle._edgecolors[0])
self._set_artist_props(p)
p.set_clip_box(None)
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-05-14 13:52:22 UTC (rev 5137)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-05-14 16:39:28 UTC (rev 5138)
@@ -1083,7 +1083,7 @@
dx, dy = self._get_xy(dx, dy, self.xycoords)
# convert the offset
- dpi = self.figure.dpi.get()
+ dpi = self.figure.get_dpi()
x *= dpi/72.
y *= dpi/72.
@@ -1095,7 +1095,7 @@
elif s=='polar':
theta, r = x, y
x = r*np.cos(theta)
- y = r*np.cosmsin(theta)
+ y = r*np.sin(theta)
trans = self.axes.transData
return trans.transform_point((x,y))
elif s=='figure points':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-14 13:54:38
|
Revision: 5137
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5137&view=rev
Author: mdboom
Date: 2008-05-14 06:52:22 -0700 (Wed, 14 May 2008)
Log Message:
-----------
Merged revisions 5135-5136 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5136 | mdboom | 2008-05-14 08:59:46 -0400 (Wed, 14 May 2008) | 2 lines
Fix font embedding on Windows.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/cbook.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5134
+ /branches/v0_91_maint:1-5136
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-14 12:59:46 UTC (rev 5136)
+++ trunk/matplotlib/CHANGELOG 2008-05-14 13:52:22 UTC (rev 5137)
@@ -1,3 +1,5 @@
+2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD
+
2008-05-09 Fix /singlequote (') in Postscript backend - MGD
2008-05-08 Fix kerning in SVG when embedding character outlines - MGD
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-14 12:59:46 UTC (rev 5136)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-14 13:52:22 UTC (rev 5137)
@@ -413,8 +413,11 @@
result = self._cache.get(path)
if result is None:
realpath = os.path.realpath(path)
- stat = os.stat(realpath)
- stat_key = (stat.st_ino, stat.st_dev)
+ if sys.platform == 'win32':
+ stat_key = realpath
+ else:
+ stat = os.stat(realpath)
+ stat_key = (stat.st_ino, stat.st_dev)
result = realpath, stat_key
self._cache[path] = result
return result
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|