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]: Type annotation foradd_subplots has incorrect return type forprojection="3d" #29334

Closed
Milestone
@stefanv

Description

@stefanv

Bug summary

The return type foradd_subplots withprojection="3d" should beAxes3D.

The current implementation is:

@overloaddefadd_subplot(self,nrows:int,ncols:int,index:int|tuple[int,int],**kwargs    )->Axes: ...@overloaddefadd_subplot(self,pos:int,**kwargs)->Axes: ...@overloaddefadd_subplot(self,ax:Axes,**kwargs)->Axes: ...@overloaddefadd_subplot(self,ax:SubplotSpec,**kwargs)->Axes: ...@overloaddefadd_subplot(self,**kwargs)->Axes: ...@overloaddefsubplots(

Code for reproduction

importmatplotlib.pyplotaspltfrommpl_toolkits.mplot3d.axes3dimportAxes3Dax:Axes3D=plt.figure().add_subplot(projection="3d")

Actual outcome

Pyright complains:

error: Type "Axes" is not assignable to declared type "Axes3D"    "Axes" is not assignable to "Axes3D" (reportAssignmentType)

Expected outcome

No error.

Additional information

No response

Operating system

No response

Matplotlib Version

3.10.0

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp