Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: plt.subplots() cannot take the sharez or shareview keyword for 3D plots #25822

Open
@scottshambaugh

Description

@scottshambaugh

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp