0

I am using the matplotlib to plot a graph. The code snippet is as below.

        err_df = inp_err.as_data_frame()
        err_df['id']=err_df.index
        print(err_df.iloc[200:220])
        err_df.plot(kind='scatter',x='id',y='Reconstruction.MSE',figsize=(20,6))
        plt.show()

it opens image in this matplotlib viewer. where i am easily able to zoom in and out and do other actions present in the above toolbar,

enter image description here

but the issue is, once I save this image then I get only a screen shot sort-of, of the image and I can't do zoom in zoom out and other actions, the way I was able to do in the matplotlib editor. Is there any way to open matplot editor from outside the code and then in which format should I save the image. Or any other way to perform the same operations like zoom as matplotlib editor with some other editor.

TIA

Katiyman
  • 827
  • 2
  • 12
  • 32
  • You can specify a location while saving as plt.savefig(‘/Users/Bazingaa/Desktop/image.png’) for rxample – Sheldore Sep 07 '18 at 07:31
  • Problem is once is save it as png it will be a static image. will not be able to zoom in to see more details.. the zoom will just make the image big – Katiyman Sep 07 '18 at 07:43
  • 1
    This topic is discussed in [Saving interactive Matplotlib figures](https://stackoverflow.com/questions/4348733/saving-interactive-matplotlib-figures) – jdr5ca Sep 07 '18 at 08:57

0 Answers0