This tag is for questions related to saving figures in matplotlib with .savefig
Questions tagged [savefig]
80 questions
0
votes
2 answers
how to plot and save multiple chart or figure using the same function?
I am trying to save both plots using same function with:
``` plot_xy(x,y,x1,y1)```
``` plot_xy(x=x,y=y,x1=x2,y1=y2)```
However, the output from the second is overwriting the first output, how can i change this to give me both figure with…

bmaster69
- 121
- 9
0
votes
2 answers
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…

SuperCiocia
- 1,823
- 6
- 23
- 40
0
votes
1 answer
Matplotlib show() and savefig() inconsistent
Code below should show the same image (green background) both when using .savefig() and .show(), but the savefig image is blank. I know that .show() clears the figures but I call it after .savefig(), so it isn't the case here. Both plt.savefig() and…

Laurie
- 19
- 3
0
votes
0 answers
Matplotlib 3D saving blank image, plt.show() not in code
I'm writing a plotting code for a 3D plot in matplotlib and I was originally trying to scale the axes so that the x and z axes were scaled larger than the y-axis. When I tried to make these edits, however, plt.savefig() started saving a blank image.…
0
votes
1 answer
How can I save image file using matplotlib. the method savefig not working
I am trying to save an image file using Matplotlib, but it doesn't seem to be working. If I run, it should save the file. But nothing happens.
I am just testing if the image-saving-code works. So the code is actually not mine. It is taken from a…

NAM
- 9
- 3
0
votes
0 answers
plt.savefig is saving an old version of the plot
I am trying to save a graph as a png file, 2/3 of them are saving the most up to date version.
However, the plot that isn't saving correctly does show the correct version IN the python file. I have tried deleting the png and it still resaves it as…

mike
- 21
- 3
0
votes
1 answer
Figures are not being saved
hey so i am trying to use this code
plt.savefig("img1.eps", format = "eps",dpi =1000)
and i get the following error
No suitable pdf to png renderer found.
any comments?
Y

Yousef Kaddoura
- 31
- 5
0
votes
0 answers
Saving matplotlib table image with wrapped cell text
I have created custom table using matplotlib, where I am wrapping long text in some of the cells. It works fine with plt.show(). However, when I save the image using plt.savefig() it loses text wrapping. Following is the code snippet I am using. Is…

aakash sheth
- 1
- 1
0
votes
0 answers
Is there another function than fig.show() to show a figure?
I'm currently trying to learn how to built a map on global mapping tool (pygmt), but whenever I try fig.show() nothing happens. I tried to change graphic backend in tools preferences. The code works because when I use fig.savefig('myfig.png') I…

Saren
- 1
- 2
0
votes
1 answer
Saving subplots with specific dimension MATLAB
I want to save 3 figures with image dimension 227×227.
Heatmap1
Heatmap1
Subplots of heatmap1 and heatmap1
How must I edit my code on MATLAB ?
n2E = rand(10); % for example
n2 = rand(10 );
% Heatmap1
subplot(2,1,1 )
heata=heatmap(n2E…

Emm
- 71
- 8
0
votes
0 answers
"Image size too large" error when saving quiver plot in python with clipping off
When I run the following code:
fig, ax = plt.subplots()
ax.quiver(np.zeros(5), np.arange(5), np.ones(5), np.ones(5))
plt.savefig('test', bbox_inches = 'tight')
Things save fine.
But when I turn clipping off on the quiver plot...
fig, ax =…

hm8
- 1,381
- 3
- 21
- 41
0
votes
1 answer
savefig returns a blank image
I am trying to plot a pandas dataframe (result_m) using the pandas plotting function, but when I try to save the figure using savefig but it returns a blank pdf. It plots fine in the notebook window. Not sure what I'm doing wrong
fig =…

user11958450
- 109
- 1
- 7
0
votes
1 answer
tight savefig without axes in matplotlib
When using a matplotlib to draw something without axes, savefig() isn't truly "tight":
import matplotlib.pyplot as plt
circ = plt.Circle((0, 0), 1.0)
plt.gca().add_artist(circ)
plt.gca().set_aspect("equal")
plt.axis("off")
#…

Nico Schlömer
- 53,797
- 27
- 201
- 249
0
votes
1 answer
Fix the figure labels in saved images
I'm trying to save a image, but the xlabels doesn't appears in saved image. I tried to modify the size figure, it works but the image become large. I would like to maintain the size and in some way show the complete plot information.
The data is…

Pedro Henrique
- 168
- 1
- 2
- 8
0
votes
1 answer
Saving multiple figures to separate files is not working even if they show() properly
I'm trying to produce two different figures to separate files (.png images) that use the same basic data, but I get blank white images. However, both figures seem ok when shown in a jupyter notebook with plt.show() statement.
My relevant code looks…

PSm
- 13
- 1
- 5