Is it possible to shorten line segments in a matplotlib plot to produce an image like the one below, where the line segments do not completely reach the point markers?
Asked
Active
Viewed 484 times
1
-
This question is a duplicate of: http://stackoverflow.com/questions/14498702/custom-plot-linestyle-in-matplotlib – Rutger Kassies Mar 25 '13 at 11:05
1 Answers
2
I've found the following stupid way, but for me it works
import matplotlib.pyplot as plt
x = [0, 1, 2, 3, 4, 5]
y = [1, 3, 2, 5, 3, 1]
plt.figure()
plt.plot(x,y,'b-')
plt.plot(x,y,'wo', markersize=25, markeredgecolor = 'w')
plt.plot(x,y,'bo', markersize=7, markeredgecolor = 'w')
plt.show()

Roman Fursenko
- 688
- 4
- 9
-
That works fine as long as you only have one plot. If several plots overlap, they can interfere with each other. There does not seem to be another way that would be reasonably simple, though. – Mar 29 '13 at 12:39