Questions tagged [axvline]
12 questions
2
votes
1 answer
Adding a verticle line using axvline in matplotlib based on datetime data
I am trying to add a vertical line using axvline to a line chart using matplotlib and am running into a recurring error. I have been looking for a solution and read what was suggested here How to draw vertical lines on a given plot in matplotlib but…

cjo000
- 33
- 7
1
vote
1 answer
Using axvline with datetimeindex
I am trying to plot a vertical line using axvline, but I keep getting errors even though I saw here that it's possible to just feed in the date into axvline: Python/Matplotlib plot vertical line for specific dates in line chart
Could anyone point…

user20856754
- 63
- 5
1
vote
1 answer
Plot histogram of all numerical columns in pandas, with mean avxline using tight layout
I am trying to get all the numerical columns plotted within a tight layout with a mean line in each of the subplots for the average of each column. I have tried several options and get the following error:
the truth value of a series is ambiguous.…

Nora
- 33
- 4
1
vote
1 answer
axvline on a specific date - weekly data
I'm trying to create a vertical line on specific date, which is not part of my df weekly date index,
and since it's not in the index, the plot is locating the vertical line on the next date that in the df…

David
- 871
- 1
- 5
- 13
0
votes
0 answers
Plot datetime.time values on x axis using axvline
I am trying to use the axvline function to plot datetime.time values and seeing this error. please help.
time_ret = datetime.time(11,15)
ax1 = axvline(time_ret, ...)
The error I get:
TypeError: '>' not supported between instances of 'float' and…

aditya
- 13
- 4
0
votes
0 answers
Issue with axvline in matplotlib
I have a problem setting axvline over my plot for dataframe.
RangeIndex: 159 entries, 0 to 158
Data columns (total 6 columns):
# Column Non-Null Count Dtype
--- ------ -------------- …

Gaurang
- 18
- 3
0
votes
1 answer
How to find the numeric value of the intersection point between an axvline and axline in matplotlib?
I have the code below and I needed to find the numerical value of the intersection point between the axline and the axvline, I have no idea how to solve this in a simple way, does anyone know how to solve it? Infinite thanks in advance! :)
!pip…

jose silva
- 15
- 2
0
votes
1 answer
How can I align text correctly on axv line using matplotlib python?
I am adding an axv line in my python plot and I would like to add text on it. I added to it correctly but the text is overlapping with the axv line. So, I would like to move it a little backward or forward. But the problem is I am dealing with dates…

Neo
- 25
- 4
0
votes
1 answer
Plot axvline using a dataframe column error: ValueError: The truth value of a DataFrame is ambiguous.
I am trying to add a horizontal line in a scatter plot based on a column of the dataframe - i got the following error: ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
x_line =…

Ana
- 27
- 4
0
votes
0 answers
Plotting vertical lines with datetime data matplotib
I would like to plot vertical lines when each new part is created on top of its features like 'Aload' or 'execution'. So I have a column called 'new_part' that indicates if a new part is created and I use it to extract the Timestamp of each new part…

G_Will
- 1
0
votes
1 answer
how to add a xvline in every polar axis in matplot
I am trying to add a line to mark quantiles for every variable in a polar chart.
When I try axvline it only draws in the first axis
axes1 = plt.gca(projection='polar')
axes1.axvline(x=0, ymin=0.2,ymax=0.6, color='k',lw=3,alpha=0.5)
I want to add…

Raculin
- 3
- 1
0
votes
0 answers
Vertical lines do not appear where they should in pyplot - pandas
I want to plot a barplot and superimpose yellow vertical lines where the column Alignment has value -1, but I fail.
For a reproducible example, some…

user8270077
- 4,621
- 17
- 75
- 140