About 11,500,000 results
Open links in new tab
  1. python - Plot a horizontal line on a given plot - Stack Overflow

    Jun 16, 2022 · How do I add a horizontal line to an existing plot? Use axhline (a horizontal axis line). For example, this plots a horizontal line at y = 0.5: If you want to draw a horizontal line in …

  2. matplotlib.axes.Axes.axhline — Matplotlib 3.10.3 documentation

    Add horizontal lines in data coordinates. Add a horizontal span (rectangle) across the axis. Add a line with an arbitrary slope.

  3. Plot a Horizontal line in Matplotlib - GeeksforGeeks

    Apr 2, 2025 · The hlines() function is used to draw one or multiple horizontal lines across a specified range on the x-axis. It is particularly useful when you need to highlight multiple levels …

  4. Comprehensive Guide to Using axhline in Matplotlib

    Jul 19, 2024 · The axhline function in Matplotlib is used to add a horizontal line across the axis of a plot. This function can be called from an Axes object, which is part of the figure. Here is the …

  5. How to Draw a Horizontal Line in Matplotlib (With Examples) - Statology

    Jun 11, 2021 · You can use the following syntax to draw a horizontal line in Matplotlib: import matplotlib. pyplot as plt #draw vertical line at y=10 plt. axhline (y=10) The following examples …

  6. Creating and Customizing Horizontal Lines in Matplotlib

    This tutorial will guide you through various ways to use and customize horizontal lines using the `matplotlib` library. ### Basic Horizontal Line with `axhline` The `axhline` function can be used …

  7. How To Plot Vertical And Horizontal Lines in Matplotlib

    Jan 9, 2023 · In this tutorial, we will demonstrate how to use matplotlib functions to plot vertical and horizontal lines in an existing plot. We will also discuss some of the options and …

  8. Horizontal line matplotlib - Python Guides

    Oct 26, 2021 · In matplotlib, the hlines () method is used to draw a horizontal line across the axes. Here hlines stand for the horizontal lines. The syntax of the hlines () method is as given below: …

  9. How to plot a horizontal line in matplotlib - Altcademy Blog

    Jan 21, 2024 · Plotting a Horizontal Line with axhline. Matplotlib makes it easy to add such a line with the axhline function. The axhline stands for 'axis horizontal line'. Here's how you can use …

  10. vertical & horizontal lines in matplotlib - Stack Overflow

    Jun 5, 2013 · Instead, use plt.plot((x1, x2), (y1, y2), 'k-') to draw a line from the point (x1, y1) to the point (x2, y2) in color k. See pyplot.plot. …

Refresh