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.
As of 2.0b4, passing
nanas a limit toxlimseems to reset both limits to(-0.001, 0.001)(try e.g. withplt.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 passinginftoxlimshould mean.)The main use case would be when the
xlimis read from some float context (e.g. from an array) where you can easily storenanbut notNone.