Skip to content

Raise error if argument to xlim is invalid, e.g., nan #7460

@anntzer

Description

@anntzer

As of 2.0b4, passing nan as a limit to xlim seems to reset both limits to (-0.001, 0.001) (try e.g. with plt.plot([0, 1]); plt.xlim(right=np.nan)). I think this should either error, or, more usefully, be interpreted as None (i.e. leave that limit as is). (For extra points, we can also bikeshed what passing inf to xlim should mean.)

The main use case would be when the xlim is read from some float context (e.g. from an array) where you can easily store nan but not None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy