capstyle/joinstyle support for matplotlib.collections.Collection #8277
Labels
Good first issue
Open a pull request against these issues if there are no active ones!
New feature
topic: rcparams
Milestone
Bug report
Bug summary
matplotlib.collections.LineCollection does not support modifying cap style and join style. I found a similar problem description on stack exchange here, but no solution could be offered.
Code for reproduction
Any plot using collections.LineCollection, for instance a matplotlib.axes.Axes.errorbar plot. Here, the error bars are drawn using a LineCollection object and the ends of the error bars are square. It would be great if they could be changed to have round caps.
Actual outcome
As expected, the LineCollection produces lines with the default cap and join styles of the renderer.
Expected outcome
This would be a new feature and has never worked with matplotlib. It would be easy to implement and performance could remain the same if the matplotlib.collections.Collection base class could be modified to support setting a default cap style and join style for the whole collection.
A simple fix would be to add "gc.set_capstyle(...)" and "gc.set_joinstyle(...)" to the Collection.draw method and add corresponding default values to the Collection object. Such a change would allow fixing the example above by adding a single line without modifying the errorbar-related code:
Matplotlib version
Matplotlib 2.0.0 all platforms.
The text was updated successfully, but these errors were encountered: