Closed
Description
The following code:
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
proj = ccrs.LambertConformal()
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=proj)
ax.set_global()
ax.coastlines()
plt.show()
gives a traceback with 3.0.0rc2:
Traceback (most recent call last):
File "/Users/rmay/miniconda3/envs/py36/lib/python3.6/site-packages/cartopy/mpl/geoaxes.py", line 1972, in <module>
matplotlib.axes._subplots._subplot_classes[GeoAxes] = GeoAxesSubplot
AttributeError: module 'matplotlib.axes._subplots' has no attribute '_subplot_classes'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test_cartopy.py", line 6, in <module>
ax = fig.add_subplot(1, 1, 1, projection=proj)
File "/Users/rmay/miniconda3/envs/py36/lib/python3.6/site-packages/matplotlib/figure.py", line 1352, in add_subplot
self, *args, **kwargs)
File "/Users/rmay/miniconda3/envs/py36/lib/python3.6/site-packages/matplotlib/projections/__init__.py", line 83, in process_projection_requirements
projection_class, extra_kwargs = projection._as_mpl_axes()
File "/Users/rmay/miniconda3/envs/py36/lib/python3.6/site-packages/cartopy/crs.py", line 148, in _as_mpl_axes
import cartopy.mpl.geoaxes as geoaxes
File "/Users/rmay/miniconda3/envs/py36/lib/python3.6/site-packages/cartopy/mpl/geoaxes.py", line 1974, in <module>
matplotlib.axes._subplot_classes[GeoAxes] = GeoAxesSubplot
AttributeError: module 'matplotlib.axes' has no attribute '_subplot_classes'
On 2.2.3 (and many versions before) it works fine.
Metadata
Metadata
Assignees
Labels
For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.