matplotlib / cheatsheets

Official Matplotlib cheat sheets
https://matplotlib.org/cheatsheets/
BSD 2-Clause "Simplified" License
7.33k stars 882 forks source link

Clarify when to use None / np.nan to segement data #113

Open tacaswell opened 2 years ago

tacaswell commented 2 years ago

see https://github.com/matplotlib/matplotlib/issues/23714

These is some user confusion about when to use ax.plot with np.nan separated data and when something like LineCollection is a better choice. In particular, using the segmented data approach the line will be drawn as a single path which will not show self-intersection for alpha < 1.

rougier commented 2 years ago

But does that mean we need to include this in the cheatsheets ? I initially added the None case because I discovered it quite lately and thought it might something worth to be known even though there is a clear difference in output.

timhoffm commented 2 years ago

This is definitely too specialized and complex for the cheetsheet. I recommend moving the topic back to our docs, e.g. to https://matplotlib.org/devdocs/users/explain/index.html