Revision: 7588
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7588&view=rev
Author: jswhit
Date: 2009-08-30 01:04:11 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
workaround for contourf bug (mask regions outside map)
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 2009-08-30
00:08:34 UTC (rev 7587)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-08-30
01:04:11 UTC (rev 7588)
@@ -2831,9 +2831,17 @@
region (see examples/contour_demo.py).""")
# mask for points outside projection limb.
xymask = np.logical_or(np.greater(x,1.e20),np.greater(y,1.e20))
+ # mask outside projection region (workaround for contourf bug?)
+ epsx = 0.1*(self.xmax-self.xmin)
+ epsy = 0.1*(self.ymax-self.ymin)
+ outsidemask = np.logical_or(np.logical_or(x > self.xmax+epsx,\
+ x < self.xmin-epsy),\
+ np.logical_or(y > self.ymax+epsy,\
+ y < self.ymin-epsy))
data = ma.asarray(data)
- # combine with data mask.
- mask = np.logical_or(ma.getmaskarray(data),xymask)
+ # combine masks.
+ mask = \
+ np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
data = ma.masked_array(data,mask=mask)
# allow callers to override the hold state by passing hold=True|False
b = ax.ishold()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins