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

Wrong datalims with empty plots with shared axes #3118

Closed
@pyatachyok

Description

@pyatachyok
importmatplotlib.pyplotaspltfig, (ax1,ax2)=plt.subplots(1,2,True,False)x1= [1,2,3,4,5,6,7,8,9]y1= [x*xforxinx1]ax1.plot(x1,y1)x2=y2=[]ax2.plot(x2,y2)plt.show()

Now ax1.get_xlim() returns erroneous (-0.06, 0.06) because when bounding boxes of two plots are united, infinitely small bounding box of ax2 (Bbox('array([[ inf, inf],\n [-inf, -inf]])')) is considered infinitely large in transforms.BboxBase.union(). E. g. transforms.BboxBase.union([ax1.dataLim, ax2.dataLim]) returns Bbox('array([[-inf, -inf],\n [ inf, inf]])') which is incorrect.

This bug prevents correct display of two plots with shared axis while one of them has empty data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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