You can easily save a figure in Matplotlib with the following code. If you want to learn Python then I will highly recommend you to read This Book.
![How to save figure in Matplotlib](https://aihints.com/wp-content/uploads/2022/03/How-to-save-figure-in-Matplotlib.png)
Save Figure in Matplotlib
The function plt.savefig is used to save a figure in Matplotlib.
from matplotlib import pyplot as plt x = [1,2,3,4,5] y = [10,20,30,40,50] plt.title("Numbers and Products") plt.xlabel("Numbers") plt.ylabel("Products") plt.plot(x,y) plt.savefig('figure.png') plt.show()
![](https://aihints.com/wp-content/uploads/2022/03/figure-2.png)
People are also reading:
What is Computer Vision? Examples, Applications, Techniques
Top 10 Computer Vision Books with Python
Books for Machine Learning (ML)