Elffuss BraidHub

kikocis/auto-code-rover public

main · 18.8 KiBRawPermalink
1Error creating AxisGrid with non-default axis class
2<!--To help us understand and resolve your issue, please fill out the form to the best of your ability.-->
3<!--You can feel free to delete the sections that do not apply.-->
4
5### Bug report
6
7**Bug summary**
8
9Creating `AxesGrid` using cartopy `GeoAxes` as `axis_class` raises `TypeError: 'method' object is not subscriptable`. Seems to be due to different behaviour of `axis` attr. for `mpl_toolkits.axes_grid1.mpl_axes.Axes` and other axes instances (like `GeoAxes`) where `axis` is only a callable. The error is raised in method `mpl_toolkits.axes_grid1.axes_grid._tick_only` when trying to access keys from `axis` attr.
10
11**Code for reproduction**
12
13<!--A minimum code snippet required to reproduce the bug.
14Please make sure to minimize the number of dependencies required, and provide
15any necessary plotted data.
16Avoid using threads, as Matplotlib is (explicitly) not thread-safe.-->
17
18```python
19import matplotlib.pyplot as plt
20from cartopy.crs import PlateCarree
21from cartopy.mpl.geoaxes import GeoAxes
22from mpl_toolkits.axes_grid1 import AxesGrid
23
24fig = plt.figure()
25axes_class = (GeoAxes, dict(map_projection=PlateCarree()))
26gr = AxesGrid(fig, 111, nrows_ncols=(1,1),
27 axes_class=axes_class)
28```
29
30**Actual outcome**
31
32<!--The output produced by the above code, which may be a screenshot, console output, etc.-->
33
34```
35Traceback (most recent call last):
36
37 File "/home/jonasg/stuff/bugreport_mpl_toolkits_AxesGrid.py", line 16, in <module>
38 axes_class=axes_class)
39
40 File "/home/jonasg/miniconda3/envs/pya/lib/python3.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py", line 618, in __init__
41 self.set_label_mode(label_mode)
42
43 File "/home/jonasg/miniconda3/envs/pya/lib/python3.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py", line 389, in set_label_mode
44 _tick_only(ax, bottom_on=False, left_on=False)
45
46 File "/home/jonasg/miniconda3/envs/pya/lib/python3.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py", line 27, in _tick_only
47 ax.axis["bottom"].toggle(ticklabels=bottom_off, label=bottom_off)
48
49TypeError: 'method' object is not subscriptable
50```
51
52**Expected outcome**
53
54<!--A description of the expected outcome from the code snippet-->
55<!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on-->
56
57**Matplotlib version**
58<!--Please specify your platform and versions of the relevant libraries you are using:-->
59 * Operating system: Ubuntu 18.04.4 LTS
60 * Matplotlib version: 3.1.2 (conda-forge)
61 * Matplotlib backend: Qt5Agg
62 * Python version: 3.7.6
63 * Jupyter version (if applicable):
64 * Other libraries:
65
66```
67# Name Version Build Channel
68_libgcc_mutex 0.1 conda_forge conda-forge
69_openmp_mutex 4.5 0_gnu conda-forge
70alabaster 0.7.12 py37_0
71antlr-python-runtime 4.7.2 py37_1001 conda-forge
72argh 0.26.2 py37_0
73astroid 2.3.3 py37_0
74atomicwrites 1.3.0 py37_1
75attrs 19.3.0 py_0 conda-forge
76autopep8 1.4.4 py_0
77babel 2.8.0 py_0
78backcall 0.1.0 py37_0
79basemap 1.2.1 py37hd759880_1 conda-forge
80bleach 3.1.0 py37_0
81bokeh 1.4.0 py37_0 conda-forge
82bzip2 1.0.8 h516909a_2 conda-forge
83ca-certificates 2019.11.28 hecc5488_0 conda-forge
84cartopy 0.17.0 py37hd759880_1006 conda-forge
85certifi 2019.11.28 py37_0 conda-forge
86cf-units 2.1.3 py37hc1659b7_0 conda-forge
87cf_units 2.0.1 py37h3010b51_1002 conda-forge
88cffi 1.13.2 py37h8022711_0 conda-forge
89cftime 1.0.4.2 py37hc1659b7_0 conda-forge
90chardet 3.0.4 py37_1003 conda-forge
91click 7.0 py_0 conda-forge
92cloudpickle 1.2.2 py_1 conda-forge
93cryptography 2.8 py37h72c5cf5_1 conda-forge
94curl 7.65.3 hf8cf82a_0 conda-forge
95cycler 0.10.0 py_2 conda-forge
96cytoolz 0.10.1 py37h516909a_0 conda-forge
97dask 2.9.2 py_0 conda-forge
98dask-core 2.9.2 py_0 conda-forge
99dbus 1.13.6 he372182_0 conda-forge
100decorator 4.4.1 py_0
101defusedxml 0.6.0 py_0
102diff-match-patch 20181111 py_0
103distributed 2.9.3 py_0 conda-forge
104docutils 0.16 py37_0
105entrypoints 0.3 py37_0
106expat 2.2.5 he1b5a44_1004 conda-forge
107flake8 3.7.9 py37_0
108fontconfig 2.13.1 h86ecdb6_1001 conda-forge
109freetype 2.10.0 he983fc9_1 conda-forge
110fsspec 0.6.2 py_0 conda-forge
111future 0.18.2 py37_0
112geonum 1.4.4 py_0 conda-forge
113geos 3.7.2 he1b5a44_2 conda-forge
114gettext 0.19.8.1 hc5be6a0_1002 conda-forge
115glib 2.58.3 py37h6f030ca_1002 conda-forge
116gmp 6.1.2 h6c8ec71_1
117gpxpy 1.4.0 py_0 conda-forge
118gst-plugins-base 1.14.5 h0935bb2_0 conda-forge
119gstreamer 1.14.5 h36ae1b5_0 conda-forge
120hdf4 4.2.13 hf30be14_1003 conda-forge
121hdf5 1.10.5 nompi_h3c11f04_1104 conda-forge
122heapdict 1.0.1 py_0 conda-forge
123icu 64.2 he1b5a44_1 conda-forge
124idna 2.8 py37_1000 conda-forge
125imagesize 1.2.0 py_0
126importlib_metadata 1.4.0 py37_0 conda-forge
127intervaltree 3.0.2 py_0
128ipykernel 5.1.4 py37h39e3cac_0
129ipython 7.11.1 py37h39e3cac_0
130ipython_genutils 0.2.0 py37_0
131iris 2.2.0 py37_1003 conda-forge
132isort 4.3.21 py37_0
133jedi 0.14.1 py37_0
134jeepney 0.4.2 py_0
135jinja2 2.10.3 py_0 conda-forge
136jpeg 9c h14c3975_1001 conda-forge
137json5 0.8.5 py_0
138jsonschema 3.2.0 py37_0
139jupyter_client 5.3.4 py37_0
140jupyter_core 4.6.1 py37_0
141jupyterlab 1.2.5 pyhf63ae98_0
142jupyterlab_server 1.0.6 py_0
143keyring 21.1.0 py37_0
144kiwisolver 1.1.0 py37hc9558a2_0 conda-forge
145krb5 1.16.4 h2fd8d38_0 conda-forge
146latlon23 1.0.7 py_0 conda-forge
147lazy-object-proxy 1.4.3 py37h7b6447c_0
148ld_impl_linux-64 2.33.1 h53a641e_7 conda-forge
149libblas 3.8.0 14_openblas conda-forge
150libcblas 3.8.0 14_openblas conda-forge
151libclang 9.0.1 default_hde54327_0 conda-forge
152libcurl 7.65.3 hda55be3_0 conda-forge
153libedit 3.1.20170329 hf8c457e_1001 conda-forge
154libffi 3.2.1 he1b5a44_1006 conda-forge
155libgcc-ng 9.2.0 h24d8f2e_2 conda-forge
156libgfortran-ng 7.3.0 hdf63c60_4 conda-forge
157libgomp 9.2.0 h24d8f2e_2 conda-forge
158libiconv 1.15 h516909a_1005 conda-forge
159liblapack 3.8.0 14_openblas conda-forge
160libllvm9 9.0.1 hc9558a2_0 conda-forge
161libnetcdf 4.7.3 nompi_h94020b1_100 conda-forge
162libopenblas 0.3.7 h5ec1e0e_6 conda-forge
163libpng 1.6.37 hed695b0_0 conda-forge
164libsodium 1.0.16 h1bed415_0
165libspatialindex 1.9.3 he6710b0_0
166libssh2 1.8.2 h22169c7_2 conda-forge
167libstdcxx-ng 9.2.0 hdf63c60_2 conda-forge
168libtiff 4.1.0 hc3755c2_3 conda-forge
169libuuid 2.32.1 h14c3975_1000 conda-forge
170libxcb 1.13 h14c3975_1002 conda-forge
171libxkbcommon 0.9.1 hebb1f50_0 conda-forge
172libxml2 2.9.10 hee79883_0 conda-forge
173locket 0.2.0 py_2 conda-forge
174lz4-c 1.8.3 he1b5a44_1001 conda-forge
175markupsafe 1.1.1 py37h516909a_0 conda-forge
176matplotlib 3.1.2 py37_1 conda-forge
177matplotlib-base 3.1.2 py37h250f245_1 conda-forge
178mccabe 0.6.1 py37_1
179mistune 0.8.4 py37h7b6447c_0
180more-itertools 8.1.0 py_0 conda-forge
181msgpack-python 0.6.2 py37hc9558a2_0 conda-forge
182nbconvert 5.6.1 py37_0
183nbformat 5.0.4 py_0
184nbsphinx 0.5.1 py_0 conda-forge
185ncurses 6.1 hf484d3e_1002 conda-forge
186netcdf4 1.5.3 nompi_py37hd35fb8e_102 conda-forge
187notebook 6.0.3 py37_0
188nspr 4.24 he1b5a44_0 conda-forge
189nss 3.47 he751ad9_0 conda-forge
190numpy 1.17.5 py37h95a1406_0 conda-forge
191numpydoc 0.9.2 py_0
192olefile 0.46 py_0 conda-forge
193openssl 1.1.1d h516909a_0 conda-forge
194owslib 0.19.0 py_2 conda-forge
195packaging 20.0 py_0 conda-forge
196pandas 0.25.3 py37hb3f55d8_0 conda-forge
197pandoc 2.2.3.2 0
198pandocfilters 1.4.2 py37_1
199parso 0.6.0 py_0
200partd 1.1.0 py_0 conda-forge
201pathtools 0.1.2 py_1
202patsy 0.5.1 py_0 conda-forge
203pcre 8.43 he1b5a44_0 conda-forge
204pexpect 4.8.0 py37_0
205pickleshare 0.7.5 py37_0
206pillow 7.0.0 py37hefe7db6_0 conda-forge
207pip 20.0.1 py37_0 conda-forge
208pluggy 0.13.0 py37_0 conda-forge
209proj4 5.2.0 he1b5a44_1006 conda-forge
210prometheus_client 0.7.1 py_0
211prompt_toolkit 3.0.3 py_0
212psutil 5.6.7 py37h516909a_0 conda-forge
213pthread-stubs 0.4 h14c3975_1001 conda-forge
214ptyprocess 0.6.0 py37_0
215py 1.8.1 py_0 conda-forge
216pyaerocom 0.9.0.dev5 dev_0 <develop>
217pycodestyle 2.5.0 py37_0
218pycparser 2.19 py37_1 conda-forge
219pydocstyle 4.0.1 py_0
220pyepsg 0.4.0 py_0 conda-forge
221pyflakes 2.1.1 py37_0
222pygments 2.5.2 py_0
223pyinstrument 3.1.2 pypi_0 pypi
224pyinstrument-cext 0.2.2 pypi_0 pypi
225pykdtree 1.3.1 py37hc1659b7_1002 conda-forge
226pyke 1.1.1 py37_1001 conda-forge
227pylint 2.4.4 py37_0
228pyopenssl 19.1.0 py37_0 conda-forge
229pyparsing 2.4.6 py_0 conda-forge
230pyproj 1.9.6 py37h516909a_1002 conda-forge
231pyqt 5.12.3 py37hcca6a23_1 conda-forge
232pyqt5-sip 4.19.18 pypi_0 pypi
233pyqtwebengine 5.12.1 pypi_0 pypi
234pyrsistent 0.15.7 py37h7b6447c_0
235pyshp 2.1.0 py_0 conda-forge
236pysocks 1.7.1 py37_0 conda-forge
237pytest 5.3.4 py37_0 conda-forge
238python 3.7.6 h357f687_2 conda-forge
239python-dateutil 2.8.1 py_0 conda-forge
240python-jsonrpc-server 0.3.4 py_0
241python-language-server 0.31.7 py37_0
242pytz 2019.3 py_0 conda-forge
243pyxdg 0.26 py_0
244pyyaml 5.3 py37h516909a_0 conda-forge
245pyzmq 18.1.0 py37he6710b0_0
246qdarkstyle 2.8 py_0
247qt 5.12.5 hd8c4c69_1 conda-forge
248qtawesome 0.6.1 py_0
249qtconsole 4.6.0 py_1
250qtpy 1.9.0 py_0
251readline 8.0 hf8c457e_0 conda-forge
252requests 2.22.0 py37_1 conda-forge
253rope 0.16.0 py_0
254rtree 0.9.3 py37_0
255scipy 1.4.1 py37h921218d_0 conda-forge
256seaborn 0.9.0 py_2 conda-forge
257secretstorage 3.1.2 py37_0
258send2trash 1.5.0 py37_0
259setuptools 45.1.0 py37_0 conda-forge
260shapely 1.6.4 py37hec07ddf_1006 conda-forge
261simplejson 3.17.0 py37h516909a_0 conda-forge
262six 1.14.0 py37_0 conda-forge
263snowballstemmer 2.0.0 py_0
264sortedcontainers 2.1.0 py_0 conda-forge
265sphinx 2.3.1 py_0
266sphinx-rtd-theme 0.4.3 pypi_0 pypi
267sphinxcontrib-applehelp 1.0.1 py_0
268sphinxcontrib-devhelp 1.0.1 py_0
269sphinxcontrib-htmlhelp 1.0.2 py_0
270sphinxcontrib-jsmath 1.0.1 py_0
271sphinxcontrib-qthelp 1.0.2 py_0
272sphinxcontrib-serializinghtml 1.1.3 py_0
273spyder 4.0.1 py37_0
274spyder-kernels 1.8.1 py37_0
275sqlite 3.30.1 hcee41ef_0 conda-forge
276srtm.py 0.3.4 py_0 conda-forge
277statsmodels 0.11.0 py37h516909a_0 conda-forge
278tblib 1.6.0 py_0 conda-forge
279terminado 0.8.3 py37_0
280testpath 0.4.4 py_0
281tk 8.6.10 hed695b0_0 conda-forge
282toolz 0.10.0 py_0 conda-forge
283tornado 6.0.3 py37h516909a_0 conda-forge
284tqdm 4.43.0 pypi_0 pypi
285traitlets 4.3.3 py37_0
286udunits2 2.2.27.6 h4e0c4b3_1001 conda-forge
287ujson 1.35 py37h14c3975_0
288urllib3 1.25.7 py37_0 conda-forge
289watchdog 0.9.0 py37_1
290wcwidth 0.1.8 py_0 conda-forge
291webencodings 0.5.1 py37_1
292wheel 0.33.6 py37_0 conda-forge
293wrapt 1.11.2 py37h7b6447c_0
294wurlitzer 2.0.0 py37_0
295xarray 0.14.1 py_1 conda-forge
296xorg-libxau 1.0.9 h14c3975_0 conda-forge
297xorg-libxdmcp 1.1.3 h516909a_0 conda-forge
298xz 5.2.4 h14c3975_1001 conda-forge
299yaml 0.2.2 h516909a_1 conda-forge
300yapf 0.28.0 py_0
301zeromq 4.3.1 he6710b0_3
302zict 1.0.0 py_0 conda-forge
303zipp 2.0.0 py_2 conda-forge
304zlib 1.2.11 h516909a_1006 conda-forge
305zstd 1.4.4 h3b9ef0a_1 conda-forge
306```
307