Use axhline
(a horizontal axis line). For example, this plots a horizontal line at y = 0.5
:
import matplotlib.pyplot as plt
plt.axhline(y=0.5, color="r", linestyle="-")
plt.show()
Related Contents:
- Improve subplot size/spacing with many subplots
- How to draw vertical lines on a given plot
- How to invert the x or y axis
- How to save a Seaborn plot into a file
- How to plot in multiple subplots
- How to add hovering annotations to a plot
- How to plot multiple dataframes in subplots
- How to add a title to a Seaborn boxplot
- How to add value labels on a bar chart
- Python matplotlib multiple bars
- plot different color for different categorical levels using matplotlib
- How do you plot a vertical line on a time series plot in Pandas?
- Pandas Plotting with Multi-Index
- How to display custom values on a bar plot
- Pandas dataframe groupby plot
- How do I add a title and axis labels to Seaborn Heatmap?
- Color by Column Values in Matplotlib
- How to plot multiple Seaborn Jointplot in Subplot
- How to have clusters of stacked bars
- How to plot multiple bars grouped
- Color a scatter plot by Column Values
- Plotting grouped data in same plot using Pandas
- How to prevent overlapping x-axis labels in sns.countplot
- Plot multiple columns of pandas DataFrame using Seaborn
- plot different color for different categorical levels
- How does one insert statistical annotations (stars or p-values)
- How to get rid of grid lines when plotting with Seaborn + Pandas with secondary_y
- How to create a stacked bar chart for my DataFrame using seaborn [duplicate]
- Seaborn plots not showing up
- Putting text in top left corner of matplotlib plot
- How to rotate x-axis tick labels in a pandas plot
- How to change the color of the axis, ticks and labels for a plot in matplotlib
- How to increase image size of pandas.DataFrame.plot
- How to plot two columns of a pandas data frame using points
- seaborn scatterplot marker size for ALL markers
- How to put legend outside the plot with pandas
- pandas DataFrame “no numeric data to plot” error
- Plotting multiple different plots in one figure using Seaborn
- Change main plot legend label text
- Bar-Plot with two bars and two y-axis
- Fine control over the font size in Seaborn plots
- How to plot a single point in matplotlib
- making matplotlib graphs look like R by default?
- How to add vertical lines to a distribution plot
- Seaborn Heatmap with logarithmic-scale colorbar
- How to change the color of the axis, ticks and labels
- How can I create stacked line graph?
- What is the process to create pdf reports with charts from a DB?
- How to save the Pandas dataframe/series data as a figure?
- Count number of elements in each column less than x