## [Matplotlib-users] Basemap fill problem

 [Matplotlib-users] Basemap fill problem From: Lionel Roubeyrie - 2007-09-12 07:53:58 ```Hi all, trying to fill some shapefiles polygons, I run into trouble like you can se= e=20 here with the fillstates.py basemap 0.9.5 example: ##################################### |examples|[1]>run fillstates.py (273, 5, [-179.14734000000001, 17.884813000000001, 0.0, 0.0], [179.77847,=20 71.352560643999809, 0.0, 0.0]) ['PERIMETER', 'DIVISION', 'NAME', 'AREA', 'RINGNUM', 'REGION', 'LSAD', 'LSA= D_TRANS', 'STATE', 'ST99_D00_I', 'SHAPENUM', 'ST99_D00_'] =2D------------------------------------------------------------------------= =2D- Traceback (most recent call last) /home/lionel/Applications/Python/Scientifique/Basemap/examples/fillstates.p= y=20 in () 87 if statenames[nshape] not in ['District of Columbia','Puerto=20 Rico']: 88 color =3D rgb2hex(colors[statenames[nshape]]) =2D--> 89 p.fill(xx,yy,color,edgecolor=3Dcolor) 90 # draw meridians and parallels. 91 m.drawparallels(nx.arange(25,65,20),labels=3D[1,0,0,0]) /usr/lib/python2.5/site-packages/matplotlib/pylab.py in fill(*args, **kwarg= s) 1858 hold(h) 1859 try: =2D> 1860 ret =3D gca().fill(*args, **kwargs) 1861 draw_if_interactive() 1862 except: /usr/lib/python2.5/site-packages/matplotlib/axes.py in fill(self, *args,=20 **kwargs) 4225 4226 patches =3D [] =2D> 4227 for poly in self._get_patches_for_fill(*args, **kwargs): 4228 self.add_patch( poly ) 4229 patches.append( poly ) /usr/lib/python2.5/site-packages/matplotlib/axes.py in _grab_next_args(self= ,=20 *args, **kwargs) 426 if not is_string_like(remaining[2]): 427 raise ValueError, 'third arg must be a format=20 string' =2D-> 428 for seg in self._plot_3_args(remaining, **kwargs): 429 yield seg 430 remaining=3D[] /usr/lib/python2.5/site-packages/matplotlib/axes.py in _plot_3_args(self,=20 tup3, **kwargs) 374 x, y, multicol =3D self._xy_from_xy(x, y) 375 =2D-> 376 linestyle, marker, color =3D _process_plot_format(fmt) 377 378 def makeline(x, y): /usr/lib/python2.5/site-packages/matplotlib/axes.py in=20 _process_plot_format(fmt) 151 else: 152 err =3D 'Unrecognized character %c in format string' % c =2D-> 153 raise ValueError, err 154 155 if linestyle is None and marker is None: : Unrecognized character # in format string WARNING: Failure executing file: ######################################## The same problem occurs with another test, in this case the "Unrecognized=20 character" is "f" :-P A solution is very welcome! Thanks =2D-=20 Lionel Roubeyrie - lroubeyrie@... Charg=C3=A9 d'=C3=A9tudes et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr ```

 [Matplotlib-users] Basemap fill problem From: Lionel Roubeyrie - 2007-09-12 07:53:58 ```Hi all, trying to fill some shapefiles polygons, I run into trouble like you can se= e=20 here with the fillstates.py basemap 0.9.5 example: ##################################### |examples|[1]>run fillstates.py (273, 5, [-179.14734000000001, 17.884813000000001, 0.0, 0.0], [179.77847,=20 71.352560643999809, 0.0, 0.0]) ['PERIMETER', 'DIVISION', 'NAME', 'AREA', 'RINGNUM', 'REGION', 'LSAD', 'LSA= D_TRANS', 'STATE', 'ST99_D00_I', 'SHAPENUM', 'ST99_D00_'] =2D------------------------------------------------------------------------= =2D- Traceback (most recent call last) /home/lionel/Applications/Python/Scientifique/Basemap/examples/fillstates.p= y=20 in () 87 if statenames[nshape] not in ['District of Columbia','Puerto=20 Rico']: 88 color =3D rgb2hex(colors[statenames[nshape]]) =2D--> 89 p.fill(xx,yy,color,edgecolor=3Dcolor) 90 # draw meridians and parallels. 91 m.drawparallels(nx.arange(25,65,20),labels=3D[1,0,0,0]) /usr/lib/python2.5/site-packages/matplotlib/pylab.py in fill(*args, **kwarg= s) 1858 hold(h) 1859 try: =2D> 1860 ret =3D gca().fill(*args, **kwargs) 1861 draw_if_interactive() 1862 except: /usr/lib/python2.5/site-packages/matplotlib/axes.py in fill(self, *args,=20 **kwargs) 4225 4226 patches =3D [] =2D> 4227 for poly in self._get_patches_for_fill(*args, **kwargs): 4228 self.add_patch( poly ) 4229 patches.append( poly ) /usr/lib/python2.5/site-packages/matplotlib/axes.py in _grab_next_args(self= ,=20 *args, **kwargs) 426 if not is_string_like(remaining[2]): 427 raise ValueError, 'third arg must be a format=20 string' =2D-> 428 for seg in self._plot_3_args(remaining, **kwargs): 429 yield seg 430 remaining=3D[] /usr/lib/python2.5/site-packages/matplotlib/axes.py in _plot_3_args(self,=20 tup3, **kwargs) 374 x, y, multicol =3D self._xy_from_xy(x, y) 375 =2D-> 376 linestyle, marker, color =3D _process_plot_format(fmt) 377 378 def makeline(x, y): /usr/lib/python2.5/site-packages/matplotlib/axes.py in=20 _process_plot_format(fmt) 151 else: 152 err =3D 'Unrecognized character %c in format string' % c =2D-> 153 raise ValueError, err 154 155 if linestyle is None and marker is None: : Unrecognized character # in format string WARNING: Failure executing file: ######################################## The same problem occurs with another test, in this case the "Unrecognized=20 character" is "f" :-P A solution is very welcome! Thanks =2D-=20 Lionel Roubeyrie - lroubeyrie@... Charg=C3=A9 d'=C3=A9tudes et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr ```
 Re: [Matplotlib-users] Basemap fill problem From: Lionel Roubeyrie - 2007-09-12 08:22:42 ```Sorry, I reply to myself, the fill function needs the 'facecolor' keyword. Have a nice day =2D-=20 Lionel Roubeyrie - lroubeyrie@... Charg=C3=A9 d'=C3=A9tudes et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr ```