I think of artists as having visual properties that persist (e.g.,
filled vs. outlined, a colormap with min and max values) even as data
associated with the artist is changed. In the edge case described
below, this doesn't seem to hold true.
I have code that animates a scatter plot by sub-selecting the data
stored in a collection artist. In cases where some frames contain no
data, the scatter artist's data is temporarily empty. On subsequent
frames (once there is data again) some of the visual properties my
filled point becomes an outlined point, as in the code below.
# Filled single point with no outline
sc = scatter(,,c=, edgecolors='none')
# Cache the data
# No data, so nothing shown. No problem.
# Now restore the original data
# Outlined single point with no fill
The fix probably has to do with Collection.update_scalarmappable.
When set_array([ ]) happens,
len(self._facecolors) > 0, therefore
self._facecolors = to_rgba([ ]),
When set_array() restores data,
len(self._facecolors) == 0, therefore
self._edgecolors = self.to_rgba()
Should is_filled vs. is_stroked be preserved in this case? If so, is
there a more elegant fix than to add is_filled and is_stroked
properties that are checked by update_scalarmappable?