- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to draw more type of lines in Matplotlib?
To draw more type of lines in Matplotlib, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Create x and y data points using numpy.
- Plot x and y data points using plot() method, with an array of dashes.
- To display the figure, use show() method.
from matplotlib import pyplot as plt import numpy as np plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True x = np.linspace(-10, 10, 100) y = np.sin(x) plt.plot(x, y, dashes=[1, 1, 2, 1, 3], linewidth=7, color='red') plt.show()
- How to draw grid lines behind Matplotlib bar graph?
- How to draw axis lines inside a plot in Matplotlib?
- How to draw lines using HTML5 Canvas?
- Draw axis lines or the origin for Matplotlib contour plot.
- How to hide lines in Matplotlib?
- How to plot overlapping lines in Matplotlib?
- How to remove lines in a Matplotlib plot?
- How to draw a filled arc in Matplotlib?
- How to draw node colormap in NetworkX/Matplotlib?
- How to name different lines in the same plot of Matplotlib?
- How to draw a line outside of an axis in Matplotlib?
- How to draw rounded line ends using Matplotlib?
- How to make markers on lines smaller in Matplotlib?
- Draw Lines with easelJS using Ticker in HTML
- How to draw axis in the middle of a figure in Matplotlib?