Fixed a bug with drawing an empty Collection - #32228
Conversation
|
This makes for a subtle difference; empty scatters won't do any of the bookkeeping that's done for non-empty ones (or even other empty I'm not sure we want to introduce that inconsistency over clarifying backend behaviour. |
|
For that concern, I could have |
|
"Artist marked as not visible" and "artist with null data" are different. It is worth it's own |
|
Okay, just making sure. Now updated. |
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
PR summary
The PR fixes a bug (fixes #32219) with drawing an empty scatter plot creating a
PathCollectionwith an emptyoffsetslist. Renderers can interpret this (incorrectly) as wanting a single marker with no offset rather than no markers. This PR simply bails out of thedraw()call whenoffsetsis empty.Fixes a bug revealed in #32219, where specifyingI'm going to create an issue for this because it opened up a can of worms. Edit: Ah, #17790 already exists, so I have created #32232 for discussion.facecolor="none"(oredgecolor="none") went down a different code path than specifying a color. It turns out that specifying"none"would not be understood as a single color – because zero colors is not equal to one color – which would prevent the optimized drawing of a collection when there is just a single path (allowing the use ofdraw_markers()instead ofdraw_path_collection()).AI Disclosure
No AI was used
PR quality check