Fix subslice optimization for long, fully nan lines. by anntzer · Pull Request #25978 · matplotlib/matplotlib

@anntzer

The subslice optimizer does not handle the case of fully nan inputs, so
the relevant check in recache() is not whether x is sorted but really
whether x is sorted and not fully nan.  Fix that.

Previously, `plt.plot([np.nan] * 2000, range(2000))` would crash.

oscargus

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request

May 30, 2023

oscargus added a commit that referenced this pull request

Jun 1, 2023
…978-on-v3.7.x

Backport PR #25978 on branch v3.7.x (Fix subslice optimization for long, fully nan lines.)