| 1 | { |
| 2 | "task_id": "matplotlib__matplotlib-26020", |
| 3 | "setup_info": { |
| 4 | "repo_path": "/home/haifeng/projects/reverse-prompt/SWE-bench/testbed/matplotlib__matplotlib/setup_matplotlib__matplotlib__3.7", |
| 5 | "env_name": "setup_matplotlib__matplotlib__3.7", |
| 6 | "pre_install": [], |
| 7 | "install": "python -m pip install -e .", |
| 8 | "test_cmd": "pytest --no-header -rA --tb=no -p no:cacheprovider lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py" |
| 9 | }, |
| 10 | "task_info": { |
| 11 | "instance_id": "matplotlib__matplotlib-26020", |
| 12 | "base_commit": "f6a781f77f5ddf1204c60ca7c544809407d4a807", |
| 13 | "hints_text": "This could probably be made to work by:\r\n\r\n a) renaming the `axis` property on `.mpl_axes.Axes` to something that does not collide with an existing method\r\n b) doing on-the-fly multiple inheritance in AxesGrid if the input axes class does not already inherit from the said Axes extension\nOk. It this begs the question of why one would use axes grid for cartopy axes?\nAn alternative change here would be to put is the type check and raise an informative error that it is not going to work.\nOTOH it may be nice to slowly move axes_grid towards an API more consistent with the rest of mpl. From a very, very quick look, I guess its `axis` dict could be compared to normal axes' `spines` dict? (an AxisArtist is vaguely like a Spine, I guess).\n> Ok. It this begs the question of why one would use axes grid for cartopy axes?\r\n\r\nThere's an [example in the Cartopy docs](https://scitools.org.uk/cartopy/docs/latest/gallery/axes_grid_basic.html).\nFor that example I get `TypeError: 'tuple' object is not callable`\nSo, I'm confused, is `axes_grid` the only way to make an array of axes from an arbitrary axes subclass? I don't see the equivalent of `axes_class=GeoAxes` for `fig.add_subplot` or `fig.subplots` etc. \nSorry for the above, I see now. That example could be changed to \r\n\r\n```python\r\n fig, axgr = plt.subplots(3, 2, constrained_layout=True,\r\n subplot_kw={'projection':projection})\r\n axgr = axgr.flat\r\n...\r\n fig.colorbar(p, ax=axgr, shrink=0.6, extend='both')\r\n```\n@jklymak the reason why I went to use AxesGrid was because it seemed the easiest for me to create multiple GeoAxes instances flexibly (i.e. with or without colorbar axes, and with flexible location of those) and with an easy control of both horizonal and vertical padding of GeoAxis instances and independently, of the colorbar axes, also because the aspect of maps (lat / lon range) tends to mess with the alignment. \r\nI know that this can all be solved via subplots or GridSpec, etc., but I found that AxisGrid was the most simple way to do this (after trying other options and always ending up having overlapping axes ticklabels or too large padding between axes, etc.). AxesGrid seems to be made for my problem and it was very easy for me to set up a subplot grid meeting my needs for e.g. plotting 12 monthly maps of climate model data with proper padding, etc. \r\n\r\n\r\nThe code I used to create initiate this figure is based on the example from the cartopy website that @QuLogic mentions above:\r\n\r\n```python\r\nfig = plt.figure(figsize=(18, 7))\r\naxes_class = (GeoAxes, dict(map_projection=ccrs.PlateCarree()))\r\naxgr = AxesGrid(fig, 111, axes_class=axes_class,\r\n nrows_ncols=(3, 4),\r\n axes_pad=(0.6, 0.5), # control padding separately for e.g. colorbar labels, axes titles, etc.\r\n cbar_location='right',\r\n cbar_mode=\"each\",\r\n cbar_pad=\"5%\",\r\n cbar_size='3%',\r\n label_mode='') \r\n\r\n# here follows the plotting code of the displayed climate data using pyaerocom by loading a 2010 monthly example model dataset, looping over the (GeoAxes, cax) instances of the grid and calling pyaerocom.plot.mapping.plot_griddeddata_on_map on the monthly subsets.\r\n```\r\n\r\nHowever, @jklymak I was not aware of the `constrained_layout` option in `subplots` and indeed, looking at [the constrained layout guide](https://matplotlib.org/3.2.1/tutorials/intermediate/constrainedlayout_guide.html), this seems to provide the control needed to not mess with padding / spacing etc. I will try this out for my problem. Nonetheless, since cartopy refers to the AxesGrid option, it may be good if this issue could be fixed in any case.\r\n\r\nAlso, constrained layout itself is declared experimental in the above guide and may be deprecated, so it may be a bit uncertain for users and developers that build upon matplotlib, what option to go for.\r\n\r\n\n@jgliss Yeah, I think I agree that `axes_grid` is useful to pack subplots together that have a certain aspect ratio. Core matplotlib takes the opposite approach and puts the white space between the axes, `axes_grid` puts the space around the axes. \r\n\r\nI agree with @anntzer comment above (https://github.com/matplotlib/matplotlib/issues/17069#issuecomment-611635018), but feel that we should move axes_grid into core matplotlib and change the API as we see fit when we do so. \r\n\r\nI also agree that its time `constrained_layout` drops its experimental tag. \r\n\r\nBack on topic, though, this seems to be a regression and we should fix it. \nRe-milestoned to 3.2.2 as this seems like it is a regression, not \"always broken\"?\nRight after I re-milestoned I see that this is with 3.1.2 so I'm confused if this ever worked?\nI re-milestoned this to 3.4 as I don't think this has ever worked without setting the kwarg `label_mode=''` (it is broken at least as far back as 2.1.0).\nActually, looks simple enough to just check what kind of object ax.axis is:\r\n```patch\r\ndiff --git i/lib/mpl_toolkits/axes_grid1/axes_grid.py w/lib/mpl_toolkits/axes_grid1/axes_grid.py\r\nindex 2b1b1d3200..8b947a5836 100644\r\n--- i/lib/mpl_toolkits/axes_grid1/axes_grid.py\r\n+++ w/lib/mpl_toolkits/axes_grid1/axes_grid.py\r\n@@ -1,5 +1,6 @@\r\n from numbers import Number\r\n import functools\r\n+from types import MethodType\r\n\r\n import numpy as np\r\n\r\n@@ -7,14 +8,20 @@ from matplotlib import _api, cbook\r\n from matplotlib.gridspec import SubplotSpec\r\n\r\n from .axes_divider import Size, SubplotDivider, Divider\r\n-from .mpl_axes import Axes\r\n+from .mpl_axes import Axes, SimpleAxisArtist\r\n\r\n\r\n def _tick_only(ax, bottom_on, left_on):\r\n bottom_off = not bottom_on\r\n left_off = not left_on\r\n- ax.axis[\"bottom\"].toggle(ticklabels=bottom_off, label=bottom_off)\r\n- ax.axis[\"left\"].toggle(ticklabels=left_off, label=left_off)\r\n+ if isinstance(ax.axis, MethodType):\r\n+ bottom = SimpleAxisArtist(ax.xaxis, 1, ax.spines[\"bottom\"])\r\n+ left = SimpleAxisArtist(ax.yaxis, 1, ax.spines[\"left\"])\r\n+ else:\r\n+ bottom = ax.axis[\"bottom\"]\r\n+ left = ax.axis[\"left\"]\r\n+ bottom.toggle(ticklabels=bottom_off, label=bottom_off)\r\n+ left.toggle(ticklabels=left_off, label=left_off)\r\n\r\n\r\n class CbarAxesBase:\r\n```\r\nseems to be enough.", |
| 14 | "created_at": "2023-05-31T21:36:23Z", |
| 15 | "test_patch": "diff --git a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py\n--- a/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py\n+++ b/lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py\n@@ -767,3 +767,7 @@ def test_anchored_locator_base_call():\n axins.set(xticks=[], yticks=[])\n \n axins.imshow(Z, extent=extent, origin=\"lower\")\n+\n+\n+def test_grid_with_axes_class_not_overriding_axis():\n+ Grid(plt.figure(), 111, (2, 2), axes_class=mpl.axes.Axes)\n", |
| 16 | "repo": "matplotlib/matplotlib", |
| 17 | "problem_statement": "Error creating AxisGrid with non-default axis class\n<!--To help us understand and resolve your issue, please fill out the form to the best of your ability.-->\r\n<!--You can feel free to delete the sections that do not apply.-->\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nCreating `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.\r\n\r\n**Code for reproduction**\r\n\r\n<!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.-->\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nfrom cartopy.crs import PlateCarree\r\nfrom cartopy.mpl.geoaxes import GeoAxes\r\nfrom mpl_toolkits.axes_grid1 import AxesGrid\r\n\r\nfig = plt.figure()\r\naxes_class = (GeoAxes, dict(map_projection=PlateCarree()))\r\ngr = AxesGrid(fig, 111, nrows_ncols=(1,1),\r\n axes_class=axes_class)\r\n```\r\n\r\n**Actual outcome**\r\n\r\n<!--The output produced by the above code, which may be a screenshot, console output, etc.-->\r\n\r\n```\r\nTraceback (most recent call last):\r\n\r\n File \"/home/jonasg/stuff/bugreport_mpl_toolkits_AxesGrid.py\", line 16, in <module>\r\n axes_class=axes_class)\r\n\r\n File \"/home/jonasg/miniconda3/envs/pya/lib/python3.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py\", line 618, in __init__\r\n self.set_label_mode(label_mode)\r\n\r\n File \"/home/jonasg/miniconda3/envs/pya/lib/python3.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py\", line 389, in set_label_mode\r\n _tick_only(ax, bottom_on=False, left_on=False)\r\n\r\n File \"/home/jonasg/miniconda3/envs/pya/lib/python3.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py\", line 27, in _tick_only\r\n ax.axis[\"bottom\"].toggle(ticklabels=bottom_off, label=bottom_off)\r\n\r\nTypeError: 'method' object is not subscriptable\r\n```\r\n\r\n**Expected outcome**\r\n\r\n<!--A description of the expected outcome from the code snippet-->\r\n<!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on-->\r\n\r\n**Matplotlib version**\r\n<!--Please specify your platform and versions of the relevant libraries you are using:-->\r\n * Operating system: Ubuntu 18.04.4 LTS\r\n * Matplotlib version: 3.1.2 (conda-forge)\r\n * Matplotlib backend: Qt5Agg \r\n * Python version: 3.7.6\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\n```\r\n# Name Version Build Channel\r\n_libgcc_mutex 0.1 conda_forge conda-forge\r\n_openmp_mutex 4.5 0_gnu conda-forge\r\nalabaster 0.7.12 py37_0 \r\nantlr-python-runtime 4.7.2 py37_1001 conda-forge\r\nargh 0.26.2 py37_0 \r\nastroid 2.3.3 py37_0 \r\natomicwrites 1.3.0 py37_1 \r\nattrs 19.3.0 py_0 conda-forge\r\nautopep8 1.4.4 py_0 \r\nbabel 2.8.0 py_0 \r\nbackcall 0.1.0 py37_0 \r\nbasemap 1.2.1 py37hd759880_1 conda-forge\r\nbleach 3.1.0 py37_0 \r\nbokeh 1.4.0 py37_0 conda-forge\r\nbzip2 1.0.8 h516909a_2 conda-forge\r\nca-certificates 2019.11.28 hecc5488_0 conda-forge\r\ncartopy 0.17.0 py37hd759880_1006 conda-forge\r\ncertifi 2019.11.28 py37_0 conda-forge\r\ncf-units 2.1.3 py37hc1659b7_0 conda-forge\r\ncf_units 2.0.1 py37h3010b51_1002 conda-forge\r\ncffi 1.13.2 py37h8022711_0 conda-forge\r\ncftime 1.0.4.2 py37hc1659b7_0 conda-forge\r\nchardet 3.0.4 py37_1003 conda-forge\r\nclick 7.0 py_0 conda-forge\r\ncloudpickle 1.2.2 py_1 conda-forge\r\ncryptography 2.8 py37h72c5cf5_1 conda-forge\r\ncurl 7.65.3 hf8cf82a_0 conda-forge\r\ncycler 0.10.0 py_2 conda-forge\r\ncytoolz 0.10.1 py37h516909a_0 conda-forge\r\ndask 2.9.2 py_0 conda-forge\r\ndask-core 2.9.2 py_0 conda-forge\r\ndbus 1.13.6 he372182_0 conda-forge\r\ndecorator 4.4.1 py_0 \r\ndefusedxml 0.6.0 py_0 \r\ndiff-match-patch 20181111 py_0 \r\ndistributed 2.9.3 py_0 conda-forge\r\ndocutils 0.16 py37_0 \r\nentrypoints 0.3 py37_0 \r\nexpat 2.2.5 he1b5a44_1004 conda-forge\r\nflake8 3.7.9 py37_0 \r\nfontconfig 2.13.1 h86ecdb6_1001 conda-forge\r\nfreetype 2.10.0 he983fc9_1 conda-forge\r\nfsspec 0.6.2 py_0 conda-forge\r\nfuture 0.18.2 py37_0 \r\ngeonum 1.4.4 py_0 conda-forge\r\ngeos 3.7.2 he1b5a44_2 conda-forge\r\ngettext 0.19.8.1 hc5be6a0_1002 conda-forge\r\nglib 2.58.3 py37h6f030ca_1002 conda-forge\r\ngmp 6.1.2 h6c8ec71_1 \r\ngpxpy 1.4.0 py_0 conda-forge\r\ngst-plugins-base 1.14.5 h0935bb2_0 conda-forge\r\ngstreamer 1.14.5 h36ae1b5_0 conda-forge\r\nhdf4 4.2.13 hf30be14_1003 conda-forge\r\nhdf5 1.10.5 nompi_h3c11f04_1104 conda-forge\r\nheapdict 1.0.1 py_0 conda-forge\r\nicu 64.2 he1b5a44_1 conda-forge\r\nidna 2.8 py37_1000 conda-forge\r\nimagesize 1.2.0 py_0 \r\nimportlib_metadata 1.4.0 py37_0 conda-forge\r\nintervaltree 3.0.2 py_0 \r\nipykernel 5.1.4 py37h39e3cac_0 \r\nipython 7.11.1 py37h39e3cac_0 \r\nipython_genutils 0.2.0 py37_0 \r\niris 2.2.0 py37_1003 conda-forge\r\nisort 4.3.21 py37_0 \r\njedi 0.14.1 py37_0 \r\njeepney 0.4.2 py_0 \r\njinja2 2.10.3 py_0 conda-forge\r\njpeg 9c h14c3975_1001 conda-forge\r\njson5 0.8.5 py_0 \r\njsonschema 3.2.0 py37_0 \r\njupyter_client 5.3.4 py37_0 \r\njupyter_core 4.6.1 py37_0 \r\njupyterlab 1.2.5 pyhf63ae98_0 \r\njupyterlab_server 1.0.6 py_0 \r\nkeyring 21.1.0 py37_0 \r\nkiwisolver 1.1.0 py37hc9558a2_0 conda-forge\r\nkrb5 1.16.4 h2fd8d38_0 conda-forge\r\nlatlon23 1.0.7 py_0 conda-forge\r\nlazy-object-proxy 1.4.3 py37h7b6447c_0 \r\nld_impl_linux-64 2.33.1 h53a641e_7 conda-forge\r\nlibblas 3.8.0 14_openblas conda-forge\r\nlibcblas 3.8.0 14_openblas conda-forge\r\nlibclang 9.0.1 default_hde54327_0 conda-forge\r\nlibcurl 7.65.3 hda55be3_0 conda-forge\r\nlibedit 3.1.20170329 hf8c457e_1001 conda-forge\r\nlibffi 3.2.1 he1b5a44_1006 conda-forge\r\nlibgcc-ng 9.2.0 h24d8f2e_2 conda-forge\r\nlibgfortran-ng 7.3.0 hdf63c60_4 conda-forge\r\nlibgomp 9.2.0 h24d8f2e_2 conda-forge\r\nlibiconv 1.15 h516909a_1005 conda-forge\r\nliblapack 3.8.0 14_openblas conda-forge\r\nlibllvm9 9.0.1 hc9558a2_0 conda-forge\r\nlibnetcdf 4.7.3 nompi_h94020b1_100 conda-forge\r\nlibopenblas 0.3.7 h5ec1e0e_6 conda-forge\r\nlibpng 1.6.37 hed695b0_0 conda-forge\r\nlibsodium 1.0.16 h1bed415_0 \r\nlibspatialindex 1.9.3 he6710b0_0 \r\nlibssh2 1.8.2 h22169c7_2 conda-forge\r\nlibstdcxx-ng 9.2.0 hdf63c60_2 conda-forge\r\nlibtiff 4.1.0 hc3755c2_3 conda-forge\r\nlibuuid 2.32.1 h14c3975_1000 conda-forge\r\nlibxcb 1.13 h14c3975_1002 conda-forge\r\nlibxkbcommon 0.9.1 hebb1f50_0 conda-forge\r\nlibxml2 2.9.10 hee79883_0 conda-forge\r\nlocket 0.2.0 py_2 conda-forge\r\nlz4-c 1.8.3 he1b5a44_1001 conda-forge\r\nmarkupsafe 1.1.1 py37h516909a_0 conda-forge\r\nmatplotlib 3.1.2 py37_1 conda-forge\r\nmatplotlib-base 3.1.2 py37h250f245_1 conda-forge\r\nmccabe 0.6.1 py37_1 \r\nmistune 0.8.4 py37h7b6447c_0 \r\nmore-itertools 8.1.0 py_0 conda-forge\r\nmsgpack-python 0.6.2 py37hc9558a2_0 conda-forge\r\nnbconvert 5.6.1 py37_0 \r\nnbformat 5.0.4 py_0 \r\nnbsphinx 0.5.1 py_0 conda-forge\r\nncurses 6.1 hf484d3e_1002 conda-forge\r\nnetcdf4 1.5.3 nompi_py37hd35fb8e_102 conda-forge\r\nnotebook 6.0.3 py37_0 \r\nnspr 4.24 he1b5a44_0 conda-forge\r\nnss 3.47 he751ad9_0 conda-forge\r\nnumpy 1.17.5 py37h95a1406_0 conda-forge\r\nnumpydoc 0.9.2 py_0 \r\nolefile 0.46 py_0 conda-forge\r\nopenssl 1.1.1d h516909a_0 conda-forge\r\nowslib 0.19.0 py_2 conda-forge\r\npackaging 20.0 py_0 conda-forge\r\npandas 0.25.3 py37hb3f55d8_0 conda-forge\r\npandoc 2.2.3.2 0 \r\npandocfilters 1.4.2 py37_1 \r\nparso 0.6.0 py_0 \r\npartd 1.1.0 py_0 conda-forge\r\npathtools 0.1.2 py_1 \r\npatsy 0.5.1 py_0 conda-forge\r\npcre 8.43 he1b5a44_0 conda-forge\r\npexpect 4.8.0 py37_0 \r\npickleshare 0.7.5 py37_0 \r\npillow 7.0.0 py37hefe7db6_0 conda-forge\r\npip 20.0.1 py37_0 conda-forge\r\npluggy 0.13.0 py37_0 conda-forge\r\nproj4 5.2.0 he1b5a44_1006 conda-forge\r\nprometheus_client 0.7.1 py_0 \r\nprompt_toolkit 3.0.3 py_0 \r\npsutil 5.6.7 py37h516909a_0 conda-forge\r\npthread-stubs 0.4 h14c3975_1001 conda-forge\r\nptyprocess 0.6.0 py37_0 \r\npy 1.8.1 py_0 conda-forge\r\npyaerocom 0.9.0.dev5 dev_0 <develop>\r\npycodestyle 2.5.0 py37_0 \r\npycparser 2.19 py37_1 conda-forge\r\npydocstyle 4.0.1 py_0 \r\npyepsg 0.4.0 py_0 conda-forge\r\npyflakes 2.1.1 py37_0 \r\npygments 2.5.2 py_0 \r\npyinstrument 3.1.2 pypi_0 pypi\r\npyinstrument-cext 0.2.2 pypi_0 pypi\r\npykdtree 1.3.1 py37hc1659b7_1002 conda-forge\r\npyke 1.1.1 py37_1001 conda-forge\r\npylint 2.4.4 py37_0 \r\npyopenssl 19.1.0 py37_0 conda-forge\r\npyparsing 2.4.6 py_0 conda-forge\r\npyproj 1.9.6 py37h516909a_1002 conda-forge\r\npyqt 5.12.3 py37hcca6a23_1 conda-forge\r\npyqt5-sip 4.19.18 pypi_0 pypi\r\npyqtwebengine 5.12.1 pypi_0 pypi\r\npyrsistent 0.15.7 py37h7b6447c_0 \r\npyshp 2.1.0 py_0 conda-forge\r\npysocks 1.7.1 py37_0 conda-forge\r\npytest 5.3.4 py37_0 conda-forge\r\npython 3.7.6 h357f687_2 conda-forge\r\npython-dateutil 2.8.1 py_0 conda-forge\r\npython-jsonrpc-server 0.3.4 py_0 \r\npython-language-server 0.31.7 py37_0 \r\npytz 2019.3 py_0 conda-forge\r\npyxdg 0.26 py_0 \r\npyyaml 5.3 py37h516909a_0 conda-forge\r\npyzmq 18.1.0 py37he6710b0_0 \r\nqdarkstyle 2.8 py_0 \r\nqt 5.12.5 hd8c4c69_1 conda-forge\r\nqtawesome 0.6.1 py_0 \r\nqtconsole 4.6.0 py_1 \r\nqtpy 1.9.0 py_0 \r\nreadline 8.0 hf8c457e_0 conda-forge\r\nrequests 2.22.0 py37_1 conda-forge\r\nrope 0.16.0 py_0 \r\nrtree 0.9.3 py37_0 \r\nscipy 1.4.1 py37h921218d_0 conda-forge\r\nseaborn 0.9.0 py_2 conda-forge\r\nsecretstorage 3.1.2 py37_0 \r\nsend2trash 1.5.0 py37_0 \r\nsetuptools 45.1.0 py37_0 conda-forge\r\nshapely 1.6.4 py37hec07ddf_1006 conda-forge\r\nsimplejson 3.17.0 py37h516909a_0 conda-forge\r\nsix 1.14.0 py37_0 conda-forge\r\nsnowballstemmer 2.0.0 py_0 \r\nsortedcontainers 2.1.0 py_0 conda-forge\r\nsphinx 2.3.1 py_0 \r\nsphinx-rtd-theme 0.4.3 pypi_0 pypi\r\nsphinxcontrib-applehelp 1.0.1 py_0 \r\nsphinxcontrib-devhelp 1.0.1 py_0 \r\nsphinxcontrib-htmlhelp 1.0.2 py_0 \r\nsphinxcontrib-jsmath 1.0.1 py_0 \r\nsphinxcontrib-qthelp 1.0.2 py_0 \r\nsphinxcontrib-serializinghtml 1.1.3 py_0 \r\nspyder 4.0.1 py37_0 \r\nspyder-kernels 1.8.1 py37_0 \r\nsqlite 3.30.1 hcee41ef_0 conda-forge\r\nsrtm.py 0.3.4 py_0 conda-forge\r\nstatsmodels 0.11.0 py37h516909a_0 conda-forge\r\ntblib 1.6.0 py_0 conda-forge\r\nterminado 0.8.3 py37_0 \r\ntestpath 0.4.4 py_0 \r\ntk 8.6.10 hed695b0_0 conda-forge\r\ntoolz 0.10.0 py_0 conda-forge\r\ntornado 6.0.3 py37h516909a_0 conda-forge\r\ntqdm 4.43.0 pypi_0 pypi\r\ntraitlets 4.3.3 py37_0 \r\nudunits2 2.2.27.6 h4e0c4b3_1001 conda-forge\r\nujson 1.35 py37h14c3975_0 \r\nurllib3 1.25.7 py37_0 conda-forge\r\nwatchdog 0.9.0 py37_1 \r\nwcwidth 0.1.8 py_0 conda-forge\r\nwebencodings 0.5.1 py37_1 \r\nwheel 0.33.6 py37_0 conda-forge\r\nwrapt 1.11.2 py37h7b6447c_0 \r\nwurlitzer 2.0.0 py37_0 \r\nxarray 0.14.1 py_1 conda-forge\r\nxorg-libxau 1.0.9 h14c3975_0 conda-forge\r\nxorg-libxdmcp 1.1.3 h516909a_0 conda-forge\r\nxz 5.2.4 h14c3975_1001 conda-forge\r\nyaml 0.2.2 h516909a_1 conda-forge\r\nyapf 0.28.0 py_0 \r\nzeromq 4.3.1 he6710b0_3 \r\nzict 1.0.0 py_0 conda-forge\r\nzipp 2.0.0 py_2 conda-forge\r\nzlib 1.2.11 h516909a_1006 conda-forge\r\nzstd 1.4.4 h3b9ef0a_1 conda-forge\r\n```\r\n\n", |
| 18 | "version": "3.7", |
| 19 | "FAIL_TO_PASS": [ |
| 20 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_with_axes_class_not_overriding_axis" |
| 21 | ], |
| 22 | "PASS_TO_PASS": [ |
| 23 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_anchored_artists[png]", |
| 24 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_anchored_direction_arrows[png]", |
| 25 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_anchored_direction_arrows_many_args[png]", |
| 26 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_anchored_locator_base_call[png]", |
| 27 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_auto_adjustable", |
| 28 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_axes_class_tuple", |
| 29 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_axes_locatable_position", |
| 30 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_axesgrid_colorbar_log_smoketest", |
| 31 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_divider_append_axes", |
| 32 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_divider_errors[CC-ValueError-'CC'", |
| 33 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_divider_errors[None-TypeError-anchor", |
| 34 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_divider_errors[anchor2-TypeError-anchor", |
| 35 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_fill_facecolor[png]", |
| 36 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_gettightbbox", |
| 37 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_axes_lists", |
| 38 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_axes_position[column]", |
| 39 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_axes_position[row]", |
| 40 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_errors[111--1-ValueError-ngrids", |
| 41 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_errors[111-7-ValueError-ngrids", |
| 42 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_grid_errors[rect0-None-TypeError-Incorrect", |
| 43 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_hbox_divider", |
| 44 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_image_grid[png]", |
| 45 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_image_grid_each_left_label_mode_all[png]", |
| 46 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_image_grid_label_mode_deprecation_warning", |
| 47 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_image_grid_single_bottom[png]", |
| 48 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_imagegrid", |
| 49 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_imagegrid_cbar_mode_edge[png]", |
| 50 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_inset_axes[png]", |
| 51 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_inset_axes_complete", |
| 52 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_inset_colorbar_tight_layout_smoketest", |
| 53 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_inset_locator[png]", |
| 54 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_insetposition[png]", |
| 55 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_mark_inset_unstales_viewlim[png]", |
| 56 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[gca-gca-big]", |
| 57 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[gca-gca-small]", |
| 58 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[host-host-big]", |
| 59 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[host-host-small]", |
| 60 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[host-parasite-big]", |
| 61 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[host-parasite-small]", |
| 62 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[parasite-host-big]", |
| 63 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[parasite-host-small]", |
| 64 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[parasite-parasite-big]", |
| 65 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_picking_callbacks_overlap[parasite-parasite-small]", |
| 66 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_removal", |
| 67 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_rgb_axes[png]", |
| 68 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_twin_axes_empty_and_removed[png]", |
| 69 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_vbox_divider", |
| 70 | "lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py::test_zooming_with_inverted_axes[png]" |
| 71 | ], |
| 72 | "environment_setup_commit": "0849036fd992a2dd133a0cffc3f84f58ccf1840f", |
| 73 | "patch": "diff --git a/lib/mpl_toolkits/axes_grid1/axes_grid.py b/lib/mpl_toolkits/axes_grid1/axes_grid.py\n--- a/lib/mpl_toolkits/axes_grid1/axes_grid.py\n+++ b/lib/mpl_toolkits/axes_grid1/axes_grid.py\n@@ -1,5 +1,6 @@\n from numbers import Number\n import functools\n+from types import MethodType\n \n import numpy as np\n \n@@ -7,14 +8,20 @@\n from matplotlib.gridspec import SubplotSpec\n \n from .axes_divider import Size, SubplotDivider, Divider\n-from .mpl_axes import Axes\n+from .mpl_axes import Axes, SimpleAxisArtist\n \n \n def _tick_only(ax, bottom_on, left_on):\n bottom_off = not bottom_on\n left_off = not left_on\n- ax.axis[\"bottom\"].toggle(ticklabels=bottom_off, label=bottom_off)\n- ax.axis[\"left\"].toggle(ticklabels=left_off, label=left_off)\n+ if isinstance(ax.axis, MethodType):\n+ bottom = SimpleAxisArtist(ax.xaxis, 1, ax.spines[\"bottom\"])\n+ left = SimpleAxisArtist(ax.yaxis, 1, ax.spines[\"left\"])\n+ else:\n+ bottom = ax.axis[\"bottom\"]\n+ left = ax.axis[\"left\"]\n+ bottom.toggle(ticklabels=bottom_off, label=bottom_off)\n+ left.toggle(ticklabels=left_off, label=left_off)\n \n \n class CbarAxesBase:\n", |
| 74 | "pr_link": "https://github.com/matplotlib/matplotlib/pull/26020" |
| 75 | } |
| 76 | } |