The documentation of savefig()
function says that the list of supported file formats depends on the used backend. How can I get this list of supported image formats for a specific backend?
Save this question. Show activity on this post. It will create the figure the first time the code is run.
savefig() As the name suggests savefig() method is used to save the figure created after plotting data. The figure created can be saved to our local machines by using this method.
What is dpi in Savefig? savefig(filename, dpi=None) to save a matplotlib. pyplot figure as an image named filename with a resolution of dpi in dots per inch. A high dpi value such as 200 or more indicates a high resolution image, while a low dpi value such as 10 indicates a lower resolution image.
Method 1: Save Plot as Image with Matplotlib using savefig() fname : path or name of output file with extension. If extension is not provided plot is saved as png file.
You just need to ask the canvas
:
plt.gcf().canvas.get_supported_filetypes()
or
plt.gcf().canvas.get_supported_filetypes_grouped()
documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With