@@ -1657,20 +1657,8 @@ def drawmapboundary(self,color='k',linewidth=1.0,fill_color=None,\
16571657 self ._fulldisk ):
16581658 limb = Ellipse ((self ._width ,self ._height ),2. * self ._width ,2. * self ._height )
16591659 if self .projection in ['ortho' ,'geos' ,'nsper' ,'aeqd' ] and self ._fulldisk :
1660- ax .set_frame_on (False )
16611660 # elliptical region.
1662- ax .add_patch (limb )
1663- self ._mapboundarydrawn = limb
1664- if fill_color is None :
1665- limb .set_fill (False )
1666- else :
1667- limb .set_facecolor (fill_color )
1668- limb .set_zorder (0 )
1669- limb .set_edgecolor (color )
1670- limb .set_linewidth (linewidth )
1671- limb .set_clip_on (True )
1672- if zorder is not None :
1673- limb .set_zorder (zorder )
1661+ ax .set_frame_on (False )
16741662 elif self .projection in _pseudocyl : # elliptical region.
16751663 ax .set_frame_on (False )
16761664 nx = 100 ; ny = 100
@@ -1694,72 +1682,35 @@ def drawmapboundary(self,color='k',linewidth=1.0,fill_color=None,\
16941682 lats = np .array (lats1 + lats2 + lats3 + lats4 ,np .float64 )
16951683 x , y = self (lons ,lats )
16961684 xy = list (zip (x ,y ))
1697- limb = Polygon (xy ,edgecolor = color ,linewidth = linewidth )
1698- ax .add_patch (limb )
1699- self ._mapboundarydrawn = limb
1700- if fill_color is None :
1701- limb .set_fill (False )
1702- else :
1703- limb .set_facecolor (fill_color )
1704- limb .set_zorder (0 )
1705- limb .set_clip_on (True )
1706- if zorder is not None :
1707- limb .set_zorder (zorder )
1685+ limb = Polygon (xy )
17081686 elif self .round :
17091687 ax .set_frame_on (False )
17101688 limb = Circle ((0.5 * (self .xmax + self .xmin ),0.5 * (self .ymax + self .ymin )),
17111689 radius = 0.5 * (self .xmax - self .xmin ),fc = 'none' )
1712- ax .add_patch (limb )
1690+ else : # all other projections are rectangular.
1691+ ax .set_frame_on (True )
1692+ for spine in ax .spines .values ():
1693+ spine .set_linewidth (linewidth )
1694+ spine .set_edgecolor (color )
1695+ if zorder is not None :
1696+ spine .set_zorder (zorder )
1697+ if self .projection not in ['geos' ,'ortho' ,'nsper' ]:
1698+ limb = ax .axesPatch
1699+
1700+ if limb is not None :
1701+ if limb is not ax .axesPatch :
1702+ ax .add_patch (limb )
17131703 self ._mapboundarydrawn = limb
17141704 if fill_color is None :
17151705 limb .set_fill (False )
17161706 else :
17171707 limb .set_facecolor (fill_color )
17181708 limb .set_zorder (0 )
1719- limb .set_clip_on (True )
1709+ limb .set_edgecolor (color )
1710+ limb .set_linewidth (linewidth )
17201711 if zorder is not None :
17211712 limb .set_zorder (zorder )
1722- else : # all other projections are rectangular.
1723- # use axesPatch for fill_color, spine for border line props.
1724- for spine in ax .spines .values ():
1725- spine .set_linewidth (linewidth )
1726- if self .projection not in ['geos' ,'ortho' ,'nsper' ]:
1727- limb = ax .axesPatch
1728- if fill_color is not None :
1729- limb .set_facecolor (fill_color )
1730- for spine in ax .spines .values ():
1731- spine .set_edgecolor (color )
1732- ax .set_frame_on (True )
1733- # FIXME? should zorder be set separately for edge and background?
1734- if zorder is not None :
1735- limb .set_zorder (zorder )
1736- for spine in ax .spines .values ():
1737- spine .set_zorder (zorder )
1738- else :
1739- # use axesPatch for fill_color, spine for border line props.
1740- for spine in ax .spines .values ():
1741- spine .set_edgecolor (color )
1742- ax .set_frame_on (True )
1743- # FIXME? should zorder be set separately for edge and background?
1744- if zorder is not None :
1745- ax .axesPatch .set_zorder (zorder )
1746- for spine in ax .spines .values ():
1747- spine .set_zorder (zorder )
1748- # for geos or ortho projections, also
1749- # draw and fill map projection limb, clipped
1750- # to rectangular region.
1751- ax .add_patch (limb )
1752- self ._mapboundarydrawn = limb
1753- if fill_color is None :
1754- limb .set_fill (False )
1755- else :
1756- limb .set_facecolor (fill_color )
1757- limb .set_zorder (0 )
1758- limb .set_edgecolor (color )
1759- limb .set_linewidth (linewidth )
1760- if zorder is not None :
1761- limb .set_zorder (zorder )
1762- limb .set_clip_on (True )
1713+ limb .set_clip_on (True )
17631714 # set axes limits to fit map region.
17641715 self .set_axes_limits (ax = ax )
17651716 return limb
0 commit comments