How to save graph using matplotlib library

+1 vote

Hi Guys,

I am analyzing one dataset with the help of matplotlib module. I am able to plot my graph. But how can I save this graph for future use?

May 21, 2020 in Python by akhtar
• 38,180 points
466 views

1 answer to this question.

0 votes

Hi@akhtar,

You can find one function called savefig in matploylib.pypolt module. This function is used to save your plot for future use.

import matplotlib.pyplot as plt
plt.savefig('fig.png')

Hope this will help you.

answered May 21, 2020 by MD
• 95,140 points

Related Questions In Python

0 votes
0 answers

How to save the import csv file to mongodb using pyspark (or python)?

I have this code, and I want ...READ MORE

Oct 9, 2019 in Python by Ahmed
• 310 points
977 views
0 votes
1 answer

How to save an image locally using Python in which we already know the URL address?

Hi, @Roshni, The following code is used to ...READ MORE

answered Jun 26, 2020 in Python by Gitika
• 65,870 points
487 views
+2 votes
2 answers

How to make a laplacian pyramid using OpenCV python?

down voteacceptTheeThe problem is that you're iterating ...READ MORE

answered Apr 3, 2018 in Python by charlie_brown
• 7,780 points
3,282 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 58,100 points
469 views
0 votes
1 answer

I can't get a graph out of my information

Hi@lzzy, According to your error, there is a ...READ MORE

answered Jun 11, 2020 in Python by MD
• 95,140 points
131 views
0 votes
1 answer

ImportError: No module named matplotlib.pyplot

Hi@akhtar, It seems you don't have matplotlib library ...READ MORE

answered Jun 22, 2020 in Python by MD
• 95,140 points
11,284 views
0 votes
1 answer

Error: Can't import matplotlib library.

Install the older version of python, I also ...READ MORE

answered Nov 6, 2020 in Python by Gitika
• 65,870 points
263 views
0 votes
1 answer

How to transfer multiple lines in a file using python?

Hi@akhtar, I don't know it will help you ...READ MORE

answered Mar 31, 2020 in Python by MD
• 95,140 points
189 views
0 votes
1 answer

How to read photo using cv2 module in python?

Hi@akhtar, Yes, you can read your image in ...READ MORE

answered Apr 9, 2020 in Python by MD
• 95,140 points
108 views