<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello all,<br>
<br>
I'm trying to use the shadedrelief() method to paint the background
of a scatter plot, but it fails. The lines below are a minimal
working example:<br>
<br>
<tt>In [1]: from mpl_toolkits.basemap import Basemap</tt><tt><br>
</tt><tt>In [2]: world_map = Basemap(projection='cyl',
llcrnrlat=-70., urcrnrlat=85., llcrnrlon=-180., urcrnrlon=180.,
resolution='l')</tt><tt><br>
</tt><tt>In [3]: world_map.shadedrelief()</tt><tt><br>
</tt><tt>---------------------------------------------------------------------------</tt><tt><br>
</tt><tt>IndexError Traceback (most
recent call last)</tt><tt><br>
</tt><tt><ipython-input-3-2f6045a33141> in <module>()</tt><tt><br>
</tt><tt>----> 1 world_map.shadedrelief()</tt><tt><br>
</tt><tt><br>
</tt><tt>/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.pyc
in shadedrelief(self, ax, scale, **kwargs)</tt><tt><br>
</tt><tt> 3997 return
self.warpimage(image='shadedrelief',ax=ax,scale=scale,**kwargs)</tt><tt><br>
</tt><tt> 3998 else:</tt><tt><br>
</tt><tt>-> 3999 return
self.warpimage(image='shadedrelief',scale=scale,**kwargs)</tt><tt><br>
</tt><tt> 4000 </tt><tt><br>
</tt><tt> 4001 def etopo(self,ax=None,scale=None,**kwargs):</tt><tt><br>
</tt><tt><br>
</tt><tt>/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.pyc
in warpimage(self, image, scale, **kwargs)</tt><tt><br>
</tt><tt> 4115 # any range of longitudes may be
plotted on a world map.</tt><tt><br>
</tt><tt> 4116 self._bm_lons = \</tt><tt><br>
</tt><tt>-> 4117
np.concatenate((self._bm_lons,self._bm_lons+360),1)</tt><tt><br>
</tt><tt> 4118 self._bm_rgba = \</tt><tt><br>
</tt><tt> 4119
np.concatenate((self._bm_rgba,self._bm_rgba),1)</tt><tt><br>
</tt><tt><br>
</tt><tt>IndexError: axis 1 out of bounds [0, 1)</tt><br>
<br>
Anyone seen this error before? I'm using python 2.7.6, numpy 1.10.4,
matplotlib 1.5.1 and basemap 1.0.7. The latter three were downloaded
as source archives and installed using 'python setup.py install'.<br>
<br>
Thanks,<br>
Sourish<br>
<br>
<div class="moz-signature">-- <br>
<b>Q:</b> What if you strapped C4 to a boomerang? Could this be an
effective weapon, or would it be as stupid as it sounds?<br>
<b>A:</b> Aerodynamics aside, I’m curious what tactical advantage
you’re expecting to gain by having the high explosive fly back at
you if it misses the target.<br>
</div>
</body>
</html>
|