|
12 | 12 |
|
13 | 13 | :func:`addcyclic`: Add cyclic (wraparound) point in longitude. |
14 | 14 | """ |
| 15 | +from distutils.version import LooseVersion |
15 | 16 | from matplotlib import __version__ as _matplotlib_version |
16 | 17 | from matplotlib.cbook import is_scalar, dedent |
17 | 18 | # check to make sure matplotlib is not too old. |
18 | | -_mpl_required_version = '0.98' |
| 19 | +_matplotlib_version = LooseVersion(_matplotlib_version) |
| 20 | +_mpl_required_version = LooseVersion('0.98') |
19 | 21 | if _matplotlib_version < _mpl_required_version: |
20 | 22 | msg = dedent(""" |
21 | 23 | your matplotlib is too old - basemap requires version %s or |
@@ -1649,7 +1651,10 @@ def drawmapboundary(self,color='k',linewidth=1.0,fill_color=None,\ |
1649 | 1651 | # if no fill_color given, use axes background color. |
1650 | 1652 | # if fill_color is string 'none', really don't fill. |
1651 | 1653 | if fill_color is None: |
1652 | | - fill_color = ax.get_axis_bgcolor() |
| 1654 | + if _matplotlib_version >= '2.0': |
| 1655 | + fill_color = ax.get_facecolor() |
| 1656 | + else: |
| 1657 | + fill_color = ax.get_axis_bgcolor() |
1653 | 1658 | elif fill_color == 'none' or fill_color == 'None': |
1654 | 1659 | fill_color = None |
1655 | 1660 | limb = None |
@@ -1744,7 +1749,10 @@ def fillcontinents(self,color='0.8',lake_color=None,ax=None,zorder=None,alpha=No |
1744 | 1749 | # get current axes instance (if none specified). |
1745 | 1750 | ax = ax or self._check_ax() |
1746 | 1751 | # get axis background color. |
1747 | | - axisbgc = ax.get_axis_bgcolor() |
| 1752 | + if _matplotlib_version >= '1.5': |
| 1753 | + axisbgc = ax.get_facecolor() |
| 1754 | + else: |
| 1755 | + axisbgc = ax.get_axis_bgcolor() |
1748 | 1756 | npoly = 0 |
1749 | 1757 | polys = [] |
1750 | 1758 | for x,y in self.coastpolygons: |
|
0 commit comments