Skip to content
Advertisement

Tag: savefig

How to overwrite `savefig` method so that it can unpack a tuple

I am working on a minimal extension to a piece of code. I have a make_fig function that used to produce just one figure, which I would call as fig in the lots of other fuctions then save it as fig.savefig. In the extension, make_fig now returns a tuple of figures. So, to save them all, I would now need

Removing white space around a saved image

I need to take an image and save it after some process. The figure looks fine when I display it, but after saving the figure, I got some white space around the saved image. I have tried the ‘tight’ option for savefig method, did not work either. The code: I am trying to draw a basic graph by using NetworkX

Advertisement