SF.net SVN: matplotlib:[6960] branches/v0_98_5_maint
Revision: 6960 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6960&view=rev Author: efiring Date: 2009-03-07 19:19:40 + (Sat, 07 Mar 2009) Log Message: --- Remove references to handle graphics; it is registered trademark of Mathworks, and the pyplot resemblance is only superficial. Modified Paths: -- branches/v0_98_5_maint/doc/_templates/index.html branches/v0_98_5_maint/doc/pyplots/tex_demo.png branches/v0_98_5_maint/doc/users/pyplot_tutorial.rst branches/v0_98_5_maint/examples/pylab_examples/axes_props.py branches/v0_98_5_maint/lib/matplotlib/pylab.py branches/v0_98_5_maint/lib/matplotlib/pyplot.py Modified: branches/v0_98_5_maint/doc/_templates/index.html === --- branches/v0_98_5_maint/doc/_templates/index.html2009-03-06 19:14:30 UTC (rev 6959) +++ branches/v0_98_5_maint/doc/_templates/index.html2009-03-07 19:19:40 UTC (rev 6960) @@ -35,7 +35,7 @@ For the power user, you have full control of line styles, font properties, axes properties, etc, via an object oriented interface - or via a handle graphics interface familiar to Matlab® users. + or via a set of functions familiar to Matlab® users. The pylab mode provides all of the pyplot plotting functions listed below, as well as non-plotting functions from http://scipy.org/Numpy_Example_List_With_Doc";>numpy and @@ -473,7 +473,7 @@ -get a handle graphics property +get a graphics property @@ -781,7 +781,7 @@ -set a handle graphics property +set a graphics property Modified: branches/v0_98_5_maint/doc/pyplots/tex_demo.png === (Binary files differ) Modified: branches/v0_98_5_maint/doc/users/pyplot_tutorial.rst === --- branches/v0_98_5_maint/doc/users/pyplot_tutorial.rst2009-03-06 19:14:30 UTC (rev 6959) +++ branches/v0_98_5_maint/doc/users/pyplot_tutorial.rst2009-03-07 19:19:40 UTC (rev 6960) @@ -78,10 +78,10 @@ line.set_antialiased(False) # turn off antialising * Use the :func:`~matplotlib.pyplot.setp` command. The example below - uses matlab handle graphics style command to set multiple properties + uses a Matlab-style command to set multiple properties on a list of lines. ``setp`` works transparently with a list of objects or a single object. You can either use python keyword arguments or - matlab-style string/value pairs:: + Matlab-style string/value pairs:: lines = plt.plot(x1, y1, x2, y2) # use keyword args Modified: branches/v0_98_5_maint/examples/pylab_examples/axes_props.py === --- branches/v0_98_5_maint/examples/pylab_examples/axes_props.py 2009-03-06 19:14:30 UTC (rev 6959) +++ branches/v0_98_5_maint/examples/pylab_examples/axes_props.py 2009-03-07 19:19:40 UTC (rev 6960) @@ -10,7 +10,7 @@ plot(t, s) grid(True) -# matlab handle graphics style +# matlab style xticklines = getp(gca(), 'xticklines') yticklines = getp(gca(), 'yticklines') xgridlines = getp(gca(), 'xgridlines') Modified: branches/v0_98_5_maint/lib/matplotlib/pylab.py === --- branches/v0_98_5_maint/lib/matplotlib/pylab.py 2009-03-06 19:14:30 UTC (rev 6959) +++ branches/v0_98_5_maint/lib/matplotlib/pylab.py 2009-03-07 19:19:40 UTC (rev 6960) @@ -42,7 +42,7 @@ gca - return the current axes gcf - return the current figure gci - get the current image, or None - getp - get a handle graphics property + getp - get a graphics property grid - set whether gridding is on hist - make a histogram hold - set the axes hold state @@ -69,7 +69,7 @@ rgrids - customize the radial grids and labels for polar savefig - save the current figure scatter - make a scatter plot - setp - set a handle graphics property + setp - set a graphics property semilogx - log x axis semilogy - log y axis show - show the figures Modified: branches/v0_98_5_maint/lib/matplotlib/pyplot.py === --- branches/v0_98_5_maint/lib/matplotlib/pyplot.py 2009-03-06 19:14:30 UTC (rev 6959) +++ branches/v0_98_5_maint/lib/matplotlib/pyplot.py 2009-03-07 19:19:40 UTC (rev 6960) @@ -193,7 +193,7 @@ *number* attribute holding this number. If *num* is an integer, and ``figure(num)`` already exists, make it -active and return the handle to it. If ``figure(num)`` does not exist +active and return a reference to it. If ``figure(num)`` does not exist it will be created. Numbering starts at 1, matlab style:: figure(1) @@ -264,7 +264,7 @@
SF.net SVN: matplotlib:[6961] trunk/matplotlib
Revision: 6961 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6961&view=rev Author: efiring Date: 2009-03-07 19:32:39 + (Sat, 07 Mar 2009) Log Message: --- Merged revisions 6960 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint r6960 | efiring | 2009-03-07 09:19:40 -1000 (Sat, 07 Mar 2009) | 4 lines Remove references to handle graphics; it is registered trademark of Mathworks, and the pyplot resemblance is only superficial. Modified Paths: -- trunk/matplotlib/doc/_templates/index.html trunk/matplotlib/doc/pyplots/tex_demo.png trunk/matplotlib/doc/users/pyplot_tutorial.rst trunk/matplotlib/examples/pylab_examples/axes_props.py trunk/matplotlib/lib/matplotlib/pylab.py trunk/matplotlib/lib/matplotlib/pyplot.py Property Changed: trunk/matplotlib/ trunk/matplotlib/doc/pyplots/README trunk/matplotlib/doc/sphinxext/gen_gallery.py trunk/matplotlib/doc/sphinxext/gen_rst.py trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py Property changes on: trunk/matplotlib ___ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6952 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6960 Modified: svn:mergeinfo - /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952 + /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960 Modified: trunk/matplotlib/doc/_templates/index.html === --- trunk/matplotlib/doc/_templates/index.html 2009-03-07 19:19:40 UTC (rev 6960) +++ trunk/matplotlib/doc/_templates/index.html 2009-03-07 19:32:39 UTC (rev 6961) @@ -35,7 +35,7 @@ For the power user, you have full control of line styles, font properties, axes properties, etc, via an object oriented interface - or via a handle graphics interface familiar to Matlab® users. + or via a set of functions familiar to Matlab® users. The pylab mode provides all of the pyplot plotting functions listed below, as well as non-plotting functions from http://scipy.org/Numpy_Example_List_With_Doc";>numpy and @@ -473,7 +473,7 @@ -get a handle graphics property +get a graphics property @@ -792,7 +792,7 @@ -set a handle graphics property +set a graphics property Property changes on: trunk/matplotlib/doc/pyplots/README ___ Modified: svn:mergeinfo - /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952 + /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960 Modified: trunk/matplotlib/doc/pyplots/tex_demo.png === (Binary files differ) Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py ___ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952 + /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,
SF.net SVN: matplotlib:[6962] trunk/toolkits/basemap
Revision: 6962
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6962&view=rev
Author: jswhit
Date: 2009-03-07 21:52:21 + (Sat, 07 Mar 2009)
Log Message:
---
add new example showing how to plot H's and L's on a pressure map (uses scipy)
Modified Paths:
--
trunk/toolkits/basemap/MANIFEST.in
trunk/toolkits/basemap/examples/README
trunk/toolkits/basemap/examples/run_all.py
Added Paths:
---
trunk/toolkits/basemap/examples/plothighsandlows.py
Modified: trunk/toolkits/basemap/MANIFEST.in
===
--- trunk/toolkits/basemap/MANIFEST.in 2009-03-07 19:32:39 UTC (rev 6961)
+++ trunk/toolkits/basemap/MANIFEST.in 2009-03-07 21:52:21 UTC (rev 6962)
@@ -11,6 +11,7 @@
include setup.cfg
include setupegg.py
include src/*
+include examples/plothighsandlows.py
include examples/save_background.py
include examples/embedding_map_in_wx.py
include examples/cubed_sphere.py
Modified: trunk/toolkits/basemap/examples/README
===
--- trunk/toolkits/basemap/examples/README 2009-03-07 19:32:39 UTC (rev
6961)
+++ trunk/toolkits/basemap/examples/README 2009-03-07 21:52:21 UTC (rev
6962)
@@ -125,3 +125,6 @@
figure (without having to redraw coastlines).
maskoceans.py shows how to mask 'wet' areas on a plot.
+
+plothighsandlows.py shows to plot H's and L's at the local extrema of a
pressure map
+(requires scipy).
Added: trunk/toolkits/basemap/examples/plothighsandlows.py
===
--- trunk/toolkits/basemap/examples/plothighsandlows.py
(rev 0)
+++ trunk/toolkits/basemap/examples/plothighsandlows.py 2009-03-07 21:52:21 UTC
(rev 6962)
@@ -0,0 +1,89 @@
+"""
+plot H's and L's on a sea-level pressure map
+"""
+import numpy as np
+import matplotlib.pyplot as plt
+import sys
+from mpl_toolkits.basemap import Basemap, NetCDFFile, addcyclic
+from scipy.ndimage.filters import minimum_filter, maximum_filter
+
+def extrema(mat,mode='wrap',window=10):
+mn = minimum_filter(mat, size=window, mode=mode)
+mx = maximum_filter(mat, size=window, mode=mode)
+# (mat == mx) true if pixel is equal to the local max
+# The next computation suppresses responses where
+# the function is flat.
+local_maxima = ((mat == mx) & (mat != mn))
+local_minima = ((mat == mn) & (mat != mx))
+# Get the indices of the maxima, minima
+return np.nonzero(local_minima), np.nonzero(local_maxima)
+
+if len(sys.argv) < 2:
+print 'enter date to plot (MMDDHH) on command line'
+raise SystemExit
+
+# get date from command line.
+MMDDHH = sys.argv[1]
+
+# open OpenDAP dataset.
+data=NetCDFFile("http://nomad1.ncep.noaa.gov:9090/dods/gdas/rotating/gdas"+MMDDHH)
+
+# read lats,lons.
+lats = data.variables['lat'][:]
+lons1 = data.variables['lon'][:]
+nlats = len(lats)
+nlons = len(lons1)
+# read prmsl, convert to hPa (mb).
+prmsl = 0.01*data.variables['prmslmsl'][0]
+# the window parameter controls the number of highs and lows detected.
+# (higher value, fewer highs and lows)
+local_min, local_max = extrema(prmsl, mode='wrap', window=25)
+# create Basemap instance.
+m =
Basemap(llcrnrlon=0,llcrnrlat=-65,urcrnrlon=360,urcrnrlat=65,projection='merc')
+# add wrap-around point in longitude.
+prmsl, lons = addcyclic(prmsl, lons1)
+# contour levels
+clevs = np.arange(900,1100.,5.)
+# find x,y of map projection grid.
+lons, lats = np.meshgrid(lons, lats)
+x, y = m(lons, lats)
+# create figure.
+fig=plt.figure(figsize=(12,6))
+cs = m.contour(x,y,prmsl,clevs,colors='k',linewidths=1.)
+m.drawcoastlines(linewidth=1.25)
+m.fillcontinents(color='0.8')
+m.drawparallels(np.arange(-80,81,20))
+m.drawmeridians(np.arange(0,360,60))
+xlows = x[local_min]; xhighs = x[local_max]
+ylows = y[local_min]; yhighs = y[local_max]
+lowvals = prmsl[local_min]; highvals = prmsl[local_max]
+# plot lows as blue L's, with min pressure value underneath.
+xyplotted = []
+# don't plot if there is already a L or H within dmin meters.
+dmin = 50
+for x,y,p in zip(xlows, ylows, lowvals):
+if x < m.xmax and x > m.xmin and y < m.ymax and y > m.ymin:
+dist = [np.sqrt((x-x0)**2+(y-y0)**2) for x0,y0 in xyplotted]
+if not dist or min(dist) > dmin:
+plt.text(x,y,'L',fontsize=14,fontweight='bold',
+ horizontalalignment='center',
+ verticalalignment='center',color='blue')
+plt.text(x,y-40,repr(int(p)),fontsize=9,
+ horizontalalignment='center',
+ verticalalignment='top',color='blue')
+xyplotted.append((x,y))
+# plot highs as red H's, with max pressure value underneath.
+xyplotted = []
+for x,y,p in zip(xhighs, yhighs, highvals):
+if x < m.xmax and x > m.xmin and y < m.ymax and y > m.ymin:
+dist = [np.sqrt((x-x0)**2+(y-y0)**2) for x0,y0
SF.net SVN: matplotlib:[6963] trunk/toolkits/basemap/examples/ plothighsandlows.py
Revision: 6963 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6963&view=rev Author: jswhit Date: 2009-03-07 21:55:59 + (Sat, 07 Mar 2009) Log Message: --- add comment Modified Paths: -- trunk/toolkits/basemap/examples/plothighsandlows.py Modified: trunk/toolkits/basemap/examples/plothighsandlows.py === --- trunk/toolkits/basemap/examples/plothighsandlows.py 2009-03-07 21:52:21 UTC (rev 6962) +++ trunk/toolkits/basemap/examples/plothighsandlows.py 2009-03-07 21:55:59 UTC (rev 6963) @@ -1,5 +1,6 @@ """ plot H's and L's on a sea-level pressure map +(uses scipy.ndimage.filters) """ import numpy as np import matplotlib.pyplot as plt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6964] trunk/toolkits/basemap/examples/ plothighsandlows.py
Revision: 6964
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6964&view=rev
Author: jswhit
Date: 2009-03-07 22:44:16 + (Sat, 07 Mar 2009)
Log Message:
---
fix URL
Modified Paths:
--
trunk/toolkits/basemap/examples/plothighsandlows.py
Modified: trunk/toolkits/basemap/examples/plothighsandlows.py
===
--- trunk/toolkits/basemap/examples/plothighsandlows.py 2009-03-07 21:55:59 UTC
(rev 6963)
+++ trunk/toolkits/basemap/examples/plothighsandlows.py 2009-03-07 22:44:16 UTC
(rev 6964)
@@ -27,7 +27,10 @@
MMDDHH = sys.argv[1]
# open OpenDAP dataset.
-data=NetCDFFile("http://nomad1.ncep.noaa.gov:9090/dods/gdas/rotating/gdas"+MMDDHH)
+try:
+
data=NetCDFFile("http://nomad1.ncep.noaa.gov:9090/dods/gdas/rotating/gdas"+MMDDHH)
+except:
+
data=NetCDFFile("http://nomad1.ncep.noaa.gov:9090/dods/gdas/rotating/"+MMDDHH[0:6]+"/gdas"+MMDDHH)
# read lats,lons.
lats = data.variables['lat'][:]
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6965] trunk/toolkits/basemap/Changelog
Revision: 6965 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6965&view=rev Author: jswhit Date: 2009-03-07 23:47:02 + (Sat, 07 Mar 2009) Log Message: --- add new example, fix formatting Modified Paths: -- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog === --- trunk/toolkits/basemap/Changelog2009-03-07 22:44:16 UTC (rev 6964) +++ trunk/toolkits/basemap/Changelog2009-03-07 23:47:02 UTC (rev 6965) @@ -1,8 +1,9 @@ version 0.99.4 (not yet released) + * added new example "plothighsandlows.py". * add fix_aspect kwarg to Basemap.__init__, when False -axes.set_aspect is set to 'auto' instead of default 'equal'. -Can be used to make plot fill whole plot region, even if the -plot region doesn't match the aspect ratio of the map region. + axes.set_aspect is set to 'auto' instead of default 'equal'. + Can be used to make plot fill whole plot region, even if the + plot region doesn't match the aspect ratio of the map region. * added date2index function, updated netcdftime to 0.7.1. * added maskoceans function. * update pupynere to version 1.0.8 (supports writing large files). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6966] trunk/matplotlib
Revision: 6966
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6966&view=rev
Author: efiring
Date: 2009-03-08 06:37:06 + (Sun, 08 Mar 2009)
Log Message:
---
Let pyplot users find out if a figure number exists, or list fignums.
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/doc/api/api_changes.rst
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2009-03-07 23:47:02 UTC (rev 6965)
+++ trunk/matplotlib/CHANGELOG 2009-03-08 06:37:06 UTC (rev 6966)
@@ -1,3 +1,5 @@
+2009-03-07 Add pyplot access to figure number list - EF
+
2009-02-28 hashing of FontProperties accounts current rcParams - JJL
2009-02-28 Prevent double-rendering of shared axis in twinx, twiny - EF
Modified: trunk/matplotlib/doc/api/api_changes.rst
===
--- trunk/matplotlib/doc/api/api_changes.rst2009-03-07 23:47:02 UTC (rev
6965)
+++ trunk/matplotlib/doc/api/api_changes.rst2009-03-08 06:37:06 UTC (rev
6966)
@@ -19,8 +19,12 @@
Changes for 0.98.x
==
-* Removed numerix package.
+* Added new :func:`matplotlib.pyplot.fignum_exists` and
+ :func:`matplotlib.pyplot.get_fignums`; they merely expose
+ information that had been hidden in :mod:`matplotlib._pylab_helpers`.
+* Deprecated numerix package.
+
* Added new :func:`matplotlib.image.imsave` and exposed it to the
:mod:`matplotlib.pyplot` interface.
@@ -46,7 +50,7 @@
-* Removed the configobj and experiemtnal traits rc support
+* Removed the configobj and experimental traits rc support
* Modified :func:`matplotlib.mlab.psd`, :func:`matplotlib.mlab.csd`,
:func:`matplotlib.mlab.cohere`, and :func:`matplotlib.mlab.specgram`
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2009-03-07 23:47:02 UTC (rev
6965)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2009-03-08 06:37:06 UTC (rev
6966)
@@ -273,6 +273,14 @@
else:
return figure()
+fignum_exists = _pylab_helpers.Gcf.has_fignum
+
+def get_fignums():
+"Return a list of existing figure numbers."
+fignums = _pylab_helpers.Gcf.figs.keys()
+fignums.sort()
+return fignums
+
def get_current_fig_manager():
figManager = _pylab_helpers.Gcf.get_active()
if figManager is None:
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
