1

We have a lot of overlapping lines plotted vertically and some are displayed with thicker lines - however when the line is thickened matplotlib seems to thicken the shortest edge of the line as well which may be a reasonable thing to do - however when the data is the same as other lines it gives a wrong impression as it can be seen in the pink line which is the same as the dark green line. Is there a built-in option in matplotlib to limit line thickness? If this does not exist, what other chart types we could use to produce a similar plot like below but without marginal error.

    import matplotlib.pyplot as plt
    
    plt.xlim(1, 10)
    plt.ylim(0,30)
    plt.grid(True, which="both")
    plt.plot([5, 5], [10, 20], "-", c="pink", linewidth=12)
    plt.plot([5, 5], [10, 20], "-", c="darkgreen", linewidth=1)

enter image description here

Curtis
  • 1,157
  • 4
  • 17
  • 30

0 Answers0