How to add row parallel to y axis in matplotlib?

I want to draw a line on x=c #constant .

It should be pretty simple, but how can I do this?

+6
source share
1 answer

You can use matplotlib.pyplot.axvline() .

 import matplotlib.pyplot as plt plt.figure() plt.axvline(x=0.2) plt.axvline(x=0.5) plt.show() 

enter image description here

+11
source

All Articles