nerodia.blogg.se

Klib 3d scanner
Klib 3d scanner







klib 3d scanner

Here, ‘line plot.jpg’ is the name of the figure saved with the extension as ‘.jpg’. Savefig( ) function explanation plt.savefig('line plot.jpg',bbox_inches='tight', dpi=150) fig.savefig() function is called before the plt.show( ).plt.figure() function is called first and then the plotting function.We can set the figure size with the plt.figure( ) function.Run the following code to find the current directory import os You can find the current working directory using the os module of python. Ĭode to save the plot as an image – matplotlib import matplotlib.pyplot as pltįig.savefig('line plot.jpg', bbox_inches='tight', dpi=150)Īs seen in the above code, we added two extra lines to save our plot to the current working directory. fig.saveplot( ), added after plot and before plt.show( ).fig = plt.figure( ), added before the plot function.We can save this graph by adding two lines in the above code

klib 3d scanner

# Declaring the points for second line plot # Declaring the points for first line plot png etc and a resolution in dpi (dots per inches) to the saved image.Ĭonsider the graph as shown above and its code import matplotlib.pyplot as plt This function saves the figure in the current working directory. We can save a matplotlib plot by using the savefig( ) function. In the previous article: Line Chart Plotting in Python using Matplotlib we have seen the following plot.

#Klib 3d scanner how to

How to save a matplotlib plot as an image in Python We can save a plot as an image easily by following the steps mentioned in this article. There are times when one needs a matplotlib figure as an image file so that we can use it for other purposes. In this article, we would learn how to save a plot as an image in python.









Klib 3d scanner