How to draw a wolverine face

How to draw any line in matplotlib

  1. How-To's
  2. Python Matplotlib HowTo's
  3. How to draw any line in matplotlib

Created: November-27, 2020

  1. Matplotlib drawing any lines with the method
  2. Matplotlib draws arbitrary lines with the methods and
  3. Matplotlib draws any lines with the help of the

This tutorial explains how we can draw any line in matplotlib using the method, the method or the method and the method.

Matplotlib drawing any lines with the method

We can just draw a line with the method. The general syntax for plotting any line starting at and ending at is:

Output:

It draws two arbitrary lines in the picture. The first line, represented by the color “green”, extends from to, and the second line, represented by the color “red”, extends from to.

Matplotlib draws arbitrary lines with the methods and

The general syntax for drawing any line using the and methods is:

Output:

The method draws a horizontal line in color, the Y coordinate of which remains throughout the line, and the X coordinate extends from to. The method draws a vertical line in green color with the X coordinate remaining on the whole line and the Y coordinate extending from to.

Matplotlib draws any lines with the help of the

Output:

It creates the collection of lines from and, and then adds the collection to the plot.

Related Article - Matplotlib Lines

  • How to fill between multiple lines in matplotlib