From: <js...@us...> - 2009-06-24 18:54:33
|
Revision: 7238 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7238&view=rev Author: jswhit Date: 2009-06-24 18:53:48 +0000 (Wed, 24 Jun 2009) Log Message: ----------- add code to import pyplot as necessary 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-06-24 18:18:55 UTC (rev 7237) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-06-24 18:53:48 UTC (rev 7238) @@ -2543,6 +2543,9 @@ Other \**kwargs passed on to matplotlib.pyplot.scatter. """ ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt # allow callers to override the hold state by passing hold=True|False b = ax.ishold() h = kwargs.pop('hold',None) @@ -2611,6 +2614,9 @@ returns an matplotlib.image.AxesImage instance. """ ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt kwargs['extent']=(self.llcrnrx,self.urcrnrx,self.llcrnry,self.urcrnry) # use origin='lower', unless overridden. if not kwargs.has_key('origin'): @@ -2653,6 +2659,9 @@ Other \**kwargs passed on to matplotlib.pyplot.pcolor. """ ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt # make x,y masked arrays # (masked where data is outside of projection limb) x = ma.masked_values(np.where(x > 1.e20,1.e20,x), 1.e20) @@ -2691,6 +2700,9 @@ Other \**kwargs passed on to matplotlib.pyplot.pcolormesh. """ ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt # allow callers to override the hold state by passing hold=True|False b = ax.ishold() h = kwargs.pop('hold',None) @@ -2725,6 +2737,9 @@ Other \*args and \**kwargs passed on to matplotlib.pyplot.contour. """ ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt # make sure x is monotonically increasing - if not, # print warning suggesting that the data be shifted in longitude # with the shiftgrid function. @@ -2789,6 +2804,9 @@ Other \*args and \**kwargs passed on to matplotlib.pyplot.scatter. """ ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt # make sure x is monotonically increasing - if not, # print warning suggesting that the data be shifted in longitude # with the shiftgrid function. @@ -2850,6 +2868,9 @@ Other \*args and \**kwargs passed on to matplotlib.pyplot.quiver. """ ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt # allow callers to override the hold state by passing hold=True|False b = ax.ishold() h = kwargs.pop('hold',None) @@ -2887,6 +2908,9 @@ you have %s""" % _matplotlib_version) raise NotImplementedError(msg) ax = kwargs.pop('ax', None) or self._check_ax() + # if ax kwarg not supplied, and ax attribute not set, import pyplot. + if self.ax is None and kwargs.pop('ax', None) is None: + import matplotlib.pyplot as plt # allow callers to override the hold state by passing hold=True|False b = ax.ishold() h = kwargs.pop('hold',None) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |