SF.net SVN: matplotlib: [5749] trunk/toolkits/basemap/doc/users

2008-07-12 Thread jswhit
Revision: 5749
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5749&view=rev
Author:   jswhit
Date: 2008-07-12 05:29:16 -0700 (Sat, 12 Jul 2008)

Log Message:
---
add omerc example

Modified Paths:
--
trunk/toolkits/basemap/doc/users/mapsetup.rst

Added Paths:
---
trunk/toolkits/basemap/doc/users/figures/omerc.py
trunk/toolkits/basemap/doc/users/omerc.rst

Added: trunk/toolkits/basemap/doc/users/figures/omerc.py
===
--- trunk/toolkits/basemap/doc/users/figures/omerc.py   
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/omerc.py   2008-07-12 12:29:16 UTC 
(rev 5749)
@@ -0,0 +1,22 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup oblique mercator basemap.
+# width is width of map projection region in km (xmax-xmin_
+# height is height of map projection region in km (ymax-ymin)
+# lon_0, lat_0 are the central longitude and latitude of the projection.
+# lat_1,lon_1 and lat_2,lon_2  are two pairs of points that define
+# the projection centerline.
+# Map projection coordinates are automatically rotated to true north.
+# To avoid this, set no_rot=True.
+m = Basemap(height=1670,width=1200,
+resolution='l',area_thresh=1000.,projection='omerc',\
+lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55)
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-80.,81.,20.))
+m.drawmeridians(np.arange(-180.,181.,20.))
+m.drawmapboundary(fill_color='aqua') 
+plt.title("Oblique Mercator Projection")
+plt.savefig('omerc.png')

Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===
--- trunk/toolkits/basemap/doc/users/mapsetup.rst   2008-07-11 18:31:04 UTC 
(rev 5748)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst   2008-07-12 12:29:16 UTC 
(rev 5749)
@@ -42,4 +42,5 @@
 cass.rst
 merc.rst
 tmerc.rst
+omerc.rst
 mill.rst

Added: trunk/toolkits/basemap/doc/users/omerc.rst
===
--- trunk/toolkits/basemap/doc/users/omerc.rst  (rev 0)
+++ trunk/toolkits/basemap/doc/users/omerc.rst  2008-07-12 12:29:16 UTC (rev 
5749)
@@ -0,0 +1,14 @@
+.. _omerc:
+
+Oblique Mercator Projection
+===
+
+The oblique aspect of the mercator projection.
+The projection centerline, instead of being a latitude (as in
+the regular mercator projection) or a longitude (as in the
+transverse mercator projection) can be an 
+arbitrary great circle (defined by specifying two points).
+
+.. literalinclude:: figures/omerc.py
+
+.. image:: figures/omerc.png


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5750] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/__init__.py

2008-07-12 Thread jswhit
Revision: 5750
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5750&view=rev
Author:   jswhit
Date: 2008-07-12 05:30:11 -0700 (Sat, 12 Jul 2008)

Log Message:
---
fix docstring typos

Modified Paths:
--
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-12 
12:29:16 UTC (rev 5749)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-12 
12:30:11 UTC (rev 5750)
@@ -257,7 +257,7 @@
  lat_1first standard parallel for lambert conformal, 
   albers equal area and equidistant conic.
   Latitude of one of the two points on the projection 
-  for oblique mercator. If lat_1 is not given, but 
+  centerline for oblique mercator. If lat_1 is not given, but 
   lat_0 is, lat_1 is set to lat_0 for lambert 
   conformal, albers equal area and equidistant conic.
  lat_2second standard parallel for lambert conformal, 
@@ -266,9 +266,9 @@
   centerline for oblique mercator. If lat_2 is not 
   given it is set to lat_1 for lambert conformal, 
   albers equal area and equidistant conic.
- lon_1longitude of one of the two points on the projection
+ lon_1Longitude of one of the two points on the projection
   centerline for oblique mercator.
- lon_2longitude of one of the two points on the projection
+ lon_2Longitude of one of the two points on the projection
   centerline for oblique mercator.
  no_rot   only used by oblique mercator.
   If set to True, the map projection coordinates will 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5751] trunk/toolkits/basemap/examples/plot_tissot. py

2008-07-12 Thread jswhit
Revision: 5751
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5751&view=rev
Author:   jswhit
Date: 2008-07-12 06:22:55 -0700 (Sat, 12 Jul 2008)

Log Message:
---
add some color

Modified Paths:
--
trunk/toolkits/basemap/examples/plot_tissot.py

Modified: trunk/toolkits/basemap/examples/plot_tissot.py
===
--- trunk/toolkits/basemap/examples/plot_tissot.py  2008-07-12 12:30:11 UTC 
(rev 5750)
+++ trunk/toolkits/basemap/examples/plot_tissot.py  2008-07-12 13:22:55 UTC 
(rev 5751)
@@ -41,7 +41,8 @@
 m.drawmeridians(np.arange(-180,180,60))
 # draw coastlines, fill continents, plot title.
 m.drawcoastlines()
-m.fillcontinents()
+m.drawmapboundary(fill_color='aqua') 
+m.fillcontinents(color='coral',lake_color='aqua')
 title = 'Tissot Diagram: projection = %s' % m.projection
 print title
 plt.title(title)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5752] trunk/matplotlib/lib/matplotlib/lines.py

2008-07-12 Thread efiring
Revision: 5752
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5752&view=rev
Author:   efiring
Date: 2008-07-12 14:04:09 -0700 (Sat, 12 Jul 2008)

Log Message:
---
Handle markerfacecolor=None etc. consistenty

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/lines.py

Modified: trunk/matplotlib/lib/matplotlib/lines.py
===
--- trunk/matplotlib/lib/matplotlib/lines.py2008-07-12 13:22:55 UTC (rev 
5751)
+++ trunk/matplotlib/lib/matplotlib/lines.py2008-07-12 21:04:09 UTC (rev 
5752)
@@ -215,12 +215,6 @@
 if linestyle is None   : linestyle=rcParams['lines.linestyle']
 if marker is None  : marker=rcParams['lines.marker']
 if color is None   : color=rcParams['lines.color']
-if markeredgecolor is None :
-markeredgecolor='auto'
-if markerfacecolor is None :
-markerfacecolor='auto'
-if markeredgewidth is None :
-markeredgewidth=rcParams['lines.markeredgewidth']
 
 if markersize is None  : markersize=rcParams['lines.markersize']
 if antialiased is None : antialiased=rcParams['lines.antialiased']
@@ -628,6 +622,8 @@
 
 ACCEPTS: any matplotlib color
 """
+if ec is None :
+ec = 'auto'
 self._markeredgecolor = ec
 
 def set_markeredgewidth(self, ew):
@@ -636,6 +632,8 @@
 
 ACCEPTS: float value in points
 """
+if ew is None :
+ew = rcParams['lines.markeredgewidth']
 self._markeredgewidth = ew
 
 def set_markerfacecolor(self, fc):
@@ -644,6 +642,8 @@
 
 ACCEPTS: any matplotlib color
 """
+if fc is None :
+fc = 'auto'
 self._markerfacecolor = fc
 
 def set_markersize(self, sz):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5753] branches/v0_91_maint/lib/matplotlib/lines.py

2008-07-12 Thread efiring
Revision: 5753
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5753&view=rev
Author:   efiring
Date: 2008-07-12 14:15:00 -0700 (Sat, 12 Jul 2008)

Log Message:
---
Handle markeredgecolor=None etc. consistently

Modified Paths:
--
branches/v0_91_maint/lib/matplotlib/lines.py

Modified: branches/v0_91_maint/lib/matplotlib/lines.py
===
--- branches/v0_91_maint/lib/matplotlib/lines.py2008-07-12 21:04:09 UTC 
(rev 5752)
+++ branches/v0_91_maint/lib/matplotlib/lines.py2008-07-12 21:15:00 UTC 
(rev 5753)
@@ -238,12 +238,6 @@
 if linestyle is None   : linestyle=rcParams['lines.linestyle']
 if marker is None  : marker=rcParams['lines.marker']
 if color is None   : color=rcParams['lines.color']
-if markeredgecolor is None :
-markeredgecolor='auto'
-if markerfacecolor is None :
-markerfacecolor='auto'
-if markeredgewidth is None :
-markeredgewidth=rcParams['lines.markeredgewidth']
 
 if markersize is None  : markersize=rcParams['lines.markersize']
 if antialiased is None : antialiased=rcParams['lines.antialiased']
@@ -654,6 +648,8 @@
 
 ACCEPTS: any matplotlib color
 """
+if ec is None:
+ec = 'auto'
 self._markeredgecolor = ec
 
 def set_markeredgewidth(self, ew):
@@ -662,6 +658,8 @@
 
 ACCEPTS: float value in points
 """
+if ew is None:
+ew = rcParams['lines.markeredgewidth']
 self._markeredgewidth = ew
 
 def set_markerfacecolor(self, fc):
@@ -670,6 +668,8 @@
 
 ACCEPTS: any matplotlib color
 """
+if fc is None:
+fc = 'auto'
 self._markerfacecolor = fc
 
 def set_markersize(self, sz):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [5754] trunk/matplotlib

2008-07-12 Thread jdh2358
Revision: 5754
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5754&view=rev
Author:   jdh2358
Date: 2008-07-12 14:33:54 -0700 (Sat, 12 Jul 2008)

Log Message:
---
added support for external backends

Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/backends/__init__.py
trunk/matplotlib/lib/matplotlib/backends/backend_template.py
trunk/matplotlib/matplotlibrc.template

Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG  2008-07-12 21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/CHANGELOG  2008-07-12 21:33:54 UTC (rev 5754)
@@ -1,3 +1,6 @@
+2008-07-12 Added support for external backends with the
+   "module://my_backend" syntax - JDH
+
 2008-07-11 Fix memory leak related to shared axes.  Grouper should
store weak references. - MGD
 

Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===
--- trunk/matplotlib/lib/matplotlib/__init__.py 2008-07-12 21:15:00 UTC (rev 
5753)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-07-12 21:33:54 UTC (rev 
5754)
@@ -801,8 +801,11 @@
 if warn: warnings.warn(_use_error_msg)
 return
 arg = arg.lower()
-be_parts = arg.split('.')
-name = validate_backend(be_parts[0])
+if arg.startswith('module://'):
+name = arg
+else:
+be_parts = arg.split('.')
+name = validate_backend(be_parts[0])
 rcParams['backend'] = name
 if name == 'cairo' and len(be_parts) > 1:
 rcParams['cairo.format'] = validate_cairo_format(be_parts[1])

Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py
===
--- trunk/matplotlib/lib/matplotlib/backends/__init__.py2008-07-12 
21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/lib/matplotlib/backends/__init__.py2008-07-12 
21:33:54 UTC (rev 5754)
@@ -1,10 +1,7 @@
 
 import matplotlib
-from matplotlib.rcsetup import interactive_bk
-from matplotlib.rcsetup import non_interactive_bk
-from matplotlib.rcsetup import all_backends
-from matplotlib.rcsetup import validate_backend
 
+
 __all__ = ['backend','show','draw_if_interactive',
'new_figure_manager', 'backend_version']
 
@@ -14,28 +11,24 @@
 'return new_figure_manager, draw_if_interactive and show for pylab'
 # Import the requested backend into a generic module object
 
-backend_name = 'backend_'+backend
-backend_name = backend_name.lower() # until we banish mixed case
-backend_mod = __import__('matplotlib.backends.'+backend_name,
+if backend.startswith('module://'):
+backend_name = backend[9:]
+else:
+backend_name = 'backend_'+backend
+backend_name = backend_name.lower() # until we banish mixed case
+backend_name = 'matplotlib.backends.%s'%backend_name.lower()
+backend_mod = __import__(backend_name,
  globals(),locals(),[backend_name])
 
 # Things we pull in from all backends
 new_figure_manager = backend_mod.new_figure_manager
 
-if hasattr(backend_mod,'backend_version'):
-backend_version = getattr(backend_mod,'backend_version')
-else: backend_version = 'unknown'
 
+def do_nothing(*args, **kwargs): pass
+backend_version = getattr(backend_mod,'backend_version', 'unknown')
+show = getattr(backend_mod, 'show', do_nothing)
+draw_if_interactive = getattr(backend_mod, 'draw_if_interactive', 
do_nothing)
 
-
-# Now define the public API according to the kind of backend in use
-if backend in interactive_bk:
-show = backend_mod.show
-draw_if_interactive = backend_mod.draw_if_interactive
-else:  # non-interactive backends
-def draw_if_interactive():  pass
-def show(): pass
-
 # Additional imports which only happen for certain backends.  This section
 # should probably disappear once all backends are uniform.
 if backend.lower() in ['wx','wxagg']:

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_template.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_template.py
2008-07-12 21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_template.py
2008-07-12 21:33:54 UTC (rev 5754)
@@ -17,7 +17,7 @@
 with 'xxx'.  Then implement the class methods and functions below, and
 add 'xxx' to the switchyard in matplotlib/backends/__init__.py and
 'xxx' to the backends list in the validate_backend methon in
-matplotlib/__init__.py and you're off.  You can use your backend with
+matplotlib/__init__.py and you're off.  You can use your backend with::
 
   import matplotlib
   matplotlib.use('xxx')
@@ -25,6 +25,17 @@
   plot([1,2,3])
   show()
 
+matplotlib also supports