Closed
Description
Bug summary
LineCollection doesn't have a get_gapcolor
or set_gapcolor
, so gapcolor doesn't work in plotting methods that return LineCollections (like vlines or hlines).
Code for reproduction
fig, ax = plt.subplots(figsize=(1,1))
ax.vlines([.25, .75], 0, 1, linestyle=':', gapcolor='orange')
Actual outcome
File ~\miniconda3\envs\prop\lib\site-packages\matplotlib\artist.py:1186, in Artist._internal_update(self, kwargs)
-> 1186 return self._update_props(
1187 kwargs, "{cls.__name__}.set() got an unexpected keyword argument "
1188 "{prop_name!r}")
AttributeError: LineCollection.set() got an unexpected keyword argument 'gapcolor'
Expected outcome
Additional information
I think the easiest fix is probably add set_color
and get_color
to LineCollection, modeled on get_color
and set_color
matplotlib/lib/matplotlib/collections.py
Lines 1463 to 1481 in 5093150
Matplotlib Version
3.7.0.dev1121+g509315008c