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

sticky_edges behavior is not consistent within/across subpots #15967

Closed
@mwaskom

Description

@mwaskom

Bug report

Bug summary

I am trying to draw lines that do not get a margin placed around them when the axis is autoscaled. My understanding is that the current way to accomplish that is withArtist.sticky_edges. But I am finding that while this works within a single Axes, it does not work across multiple Axes

Code for reproduction

This works:

f,ax=plt.subplots()ax.scatter([0,1], [0,0])x1=ax.get_xlim()line,=ax.plot(x1, [0,0])line.sticky_edges.x[:]=x1ax.scatter([0,1], [1,1])x2=ax.get_xlim()line,=ax.plot(x2, [1,1])line.sticky_edges.x[:]=x2assertx1==x2

While this fails:

f, (ax1,ax2)=plt.subplots(1,2,sharex=True,sharey=True)ax1.scatter([0,1], [0,0])x1=ax1.get_xlim()line,=ax1.plot(x1, [0,0])line.sticky_edges.x[:]=x1ax2.scatter([0,1], [1,1])x2=ax2.get_xlim()line,=ax2.plot(x2, [1,1])line.sticky_edges.x[:]=x2assertx1==x2

Is this expected to work? I know there are active changes to the autoscaling behavior; is this a bug that has been fixed (I'm not in a position to test things on a development build right now). Is there a different way to accomplish "ignore an artist when autoscaling"?

Matplotlib version

  • Operating system: macos
  • Matplotlib version: 3.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): inline
  • Python version: 3.7

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