23 Apr Matplotlib – Change the line width
To change the line width of a line graph in Matplotlib, use the linewidth parameter of the plot() function. Let us see an example:
# Set the line width import matplotlib.pyplot as plt import numpy as np ypts = np.array([7, 3, 9, 1, 5]) plt.plot(ypts, linewidth='10') plt.show()
Output

If you liked the tutorial, spread the word and share the link and our website, Studyopedia, with others.
For Videos, Join Our YouTube Channel: Join Now
Read more:
- Machine Learning Tutorial
- Deep Learning Tutorial
- Statistics for ML
- Numpy Tutorial
- Pandas Tutorial
- Matplotlib Tutorial
- Google Colab Tutorial
- Anaconda Tutorial
- Python Libraries Tutorial
No Comments