'Store an extra property in a matplotlib.collections

Segments are in red Ticks in blue.

How to save extra information, for example the segment number, on the added ticks that I have added from a mouse event on the segment ?

I would be able to identify from which segment a tick comes from.

enter image description here

The complete running example is available from : https://github.com/PBrockmann/StripesCounter/blob/main/lineCollection_02.py



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source