I’m updating the matplotlib interface for igraph and cannot quite figure out how to solve this issue. Any help would be kindly appreciated.
I create two circles as a PatchCollection, with radii in point units and offsets in data units - we want the dots to keep the same size upon zooming, and they should not become ellipses when ax.set_aspect is invoked. So far so good.
Now I’d like to draw a line that connects the circles edge to edge, without overlapping. That should hold even upon zoom, so I need some kind of transform whereby transData is applied first, then each of the two ends of the line is offset by a different vector (the left end should move a few points to the right, and vice versa for the left end of the line).
So going from this:
to this (gimp edited):
Can anyone suggest how to achieve this?
(notice that hiding the line behind is not enough, it really has to go edge-to-edge)
Thanks for the quick reply. I mean, it’s a line with two dots. The first figure you can just
The second figure is the matter at hand.
I’ve tried a bunch of things including offset transforms and scaled translations. I got one version working half well by subclassing LineCollection and triggering a path recalculation inside draw but it’s messy.
Has anyone gotten this to work or a suggestion as of how to proceed?