23
23
(_mpl_required_version ,_matplotlib_version ))
24
24
raise ImportError (msg )
25
25
from matplotlib import rcParams , is_interactive
26
- from matplotlib .collections import LineCollection
26
+ from matplotlib .collections import LineCollection , PolyCollection
27
27
from matplotlib .patches import Ellipse , Circle , Polygon , FancyArrowPatch
28
28
from matplotlib .lines import Line2D
29
29
from matplotlib .transforms import Bbox
@@ -1956,7 +1956,7 @@ def drawstates(self,linewidth=0.5,linestyle='solid',color='k',antialiased=1,ax=N
1956
1956
return states
1957
1957
1958
1958
def drawcounties (self ,linewidth = 0.1 ,linestyle = 'solid' ,color = 'k' ,antialiased = 1 ,
1959
- ax = None ,zorder = None ,drawbounds = False ):
1959
+ facecolor = 'none' , ax = None ,zorder = None ,drawbounds = False ):
1960
1960
"""
1961
1961
Draw county boundaries in US. The county boundary shapefile
1962
1962
originates with the NOAA Coastal Geospatial Data Project
@@ -1970,6 +1970,7 @@ def drawcounties(self,linewidth=0.1,linestyle='solid',color='k',antialiased=1,
1970
1970
linewidth county boundary line width (default 0.1)
1971
1971
linestyle coastline linestyle (default solid)
1972
1972
color county boundary line color (default black)
1973
+ facecolor fill color of county (default is no fill)
1973
1974
antialiased antialiasing switch for county boundaries
1974
1975
(default True).
1975
1976
ax axes instance (overrides default axes instance)
@@ -1985,10 +1986,11 @@ def drawcounties(self,linewidth=0.1,linestyle='solid',color='k',antialiased=1,
1985
1986
county_info = self .readshapefile (gis_file ,'counties' ,\
1986
1987
default_encoding = 'latin-1' ,drawbounds = drawbounds )
1987
1988
counties = [coords for coords in self .counties ]
1988
- counties = LineCollection (counties )
1989
+ counties = PolyCollection (counties )
1989
1990
counties .set_linestyle (linestyle )
1990
1991
counties .set_linewidth (linewidth )
1991
- counties .set_color (color )
1992
+ counties .set_edgecolor (color )
1993
+ counties .set_facecolor (facecolor )
1992
1994
counties .set_label ('counties' )
1993
1995
if zorder :
1994
1996
counties .set_zorder (zorder )
0 commit comments