Skip to content

Adjust autoscale behavior for ax.axline #16264

Open

Description

@eric-wieser

From #15330 (comment)

I've come across two use-cases where this scaling behavior is undesirable:

  • I'm plotting a line with a single special point (eg, a ray, and I'm ok with the backwards portion of the line). If I plot (origin, origin + direction), then my axis bounds scale to meet origin + direction, even though that point is arbitrary. I can work around that with a hack like (origin, origin + eps*direction), but it forces me to trade off axis scaling against precision.

  • I'm plotting a true infinite line, with no special points. Perhaps ideally I'd get axis scaling that shows the "nearest" part of the line, but I'd be ok with just passing autoscale=False to axline to have it skip this step.

Originally posted by @eric-wieser in #15330

Activity

  1. anntzer commented on Jan 19, 2020

    @anntzer
    Contributor

    I explicitly considered that in #15330 (see Note). I'm basically hoping to get #15595 in (I suggested that functionality during a hackathon) which should provide this behavior for all artists at once, rather that having to implement it in a piecemean fashion for each of them. (Yes, I promised to do the final push to get #15595 in, but it fell a bit off my priority list...)
    I chose to make the default (behave as) in_autoscale=True for axline() because that's basically consistent with all other plotting methods.

  2. jklymak commented on Jan 19, 2020

    @jklymak
    Member

    Ok but this is pretty inconsistent. First we are told that it’s easy to turn slope intercept into two points, but then we are told to be careful which two points we choose because it will change the autoscaling.

  3. anntzer commented on Jan 20, 2020

    @anntzer
    Contributor

    But hopefully you won't need to be careful about that as soon as #15595 gets in... which is really quite close.

  4. QuLogic commented on Mar 2, 2023

    @QuLogic
    Member

    You can now specify axline with a slope #16337, so the first point is handled.

  5. github-actions commented on Apr 27, 2026

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  6. added
    keepItems to be ignored by the “Stale” Github Action
    on Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepItems to be ignored by the “Stale” Github Actionstatus: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions