I have an image and I'd like to draw a representation of a graph over it. Edges are supposed to be two-colour lines where each color will represent one out of two properties of an edge.
I tried to draw two lines and translate them but there are cases where they overlap:
tr = ...
plt.plot([x1 - tr, x2 - tr], [y1 - tr, y2 - tr], linewidth=...)
plt.plot([x1 + tr, x2 + tr], [y1 + tr, y2 + tr], linewidth=...)
My question is: is there any smart way, to achieve this? Maybe is it possible with some patch?
Changing a library would be problematic here and I would like to keep matplotlib.
Note: line should have two colours like this
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
not like this:
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbrrrrrrrrrrrrrrrrrrrrrrrrrrr
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbrrrrrrrrrrrrrrrrrrrrrrrrrrr