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

[ENH]: Be able to ignore specific plots when autoscaling axes #29634

Open
@edbennett

Description

@edbennett

Problem

When building up scatter or error bar plots of data, I frequently want to overlay a fitting function or other set of lines/bands. The latter need to extend for the full width/height of the Axes. If I'm using autoscaling, this doesn't happen because the scale adjusts to leave a margin around the new plots.

Currently, to avoid this, I need to do something like:

xlim, ylim = ax.get_xlim(), ax.get_ylim()plt.plot(...) # Add linesax.set_xlim(xlim)ax.set_ylim(ylim)

This means I am constrained in how I order my code—I have to have all my data contributing to autoscaling present before I add any fit lines. (This gets more complicated when I am working with multiple Axes withsharex orsharey.)

Example of what I might be looking for:

Image

Example of what I currently get without the workaround above:

Image

Proposed solution

Ideally, have a new keyword argument onplot and friends, something likeuse_in_autoscale: bool = True. WhenTrue, the object generated byplot contributes to the axis limit computations as currently; whenFalse, then it is ignored in these computations.

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