Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Bug summary
When initializing 3D plots using the plt.subplots interface, thesharez
keyword is not implemented. This also applies to theshareview
keyword introduced in#25821.
Would like to get some other opinions on if 3d-specific keywords should go into the Figure / subplots method.
Code for reproduction
importmatplotlib.pyplotaspltfig,axs=plt.subplots(1,2,subplot_kw={'projection':'3d'},sharex=True)# worksfig,axs=plt.subplots(1,2,subplot_kw={'projection':'3d'},sharey=True)# worksfig,axs=plt.subplots(1,2,subplot_kw={'projection':'3d'},sharez=True)# failsfig,axs=plt.subplots(1,2,subplot_kw={'projection':'3d'},shareview=True)# fails
Actual outcome
Exception has occurred: AttributeErrorFigure.set() got an unexpected keyword argument 'sharez' File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/artist.py", line 1192, in _update_props raise AttributeError( File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/artist.py", line 1218, in _internal_update return self._update_props( ^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/artist.py", line 1226, in set return self._internal_update(cbook.normalize_kwargs(kwargs, self)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/artist.py", line 147, in <lambda> cls.set = lambda self, **kwargs: Artist.set(self, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/figure.py", line 201, in __init__ self.set(**kwargs) File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/figure.py", line 2459, in __init__ super().__init__(**kwargs) File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/backend_bases.py", line 3387, in new_figure_manager fig = fig_cls(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/pyplot.py", line 429, in new_figure_manager return _get_backend_mod().new_figure_manager(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/pyplot.py", line 898, in figure manager = new_figure_manager( ^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/lib/matplotlib/pyplot.py", line 1562, in subplots fig = figure(**fig_kw) ^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/test_3d_plot.py", line 18, in <module> fig, axs = plt.subplots(1, 2, subplot_kw={'projection': '3d'}, sharez=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError: Figure.set() got an unexpected keyword argument 'sharez'
Expected outcome
Plot should generate and share z axes.
Matplotlib Version
latest main
Installation
None