Questions tagged [savefig]

This tag is for questions related to saving figures in matplotlib with .savefig

matplotlib.pyplot.savefig

80 questions
1
vote
0 answers

Why `ValueError: minvalue must be positive` occurred after that I run `plt.savefig()`?

Now I have one (1024, 1024) NumPy array named field which is stored in a .bigfile. And I want to visualize its values on the x-y plane by using plt.imshow. By the way, the minimum of field is 0.0, the maximum is 89297.414.Here is a snippet of this…
Stephen Wong
  • 101
  • 12
1
vote
1 answer

savefig png where its file name is exactly the same as the excel sheet for loop

I have an excel (screen shot below) file with two sheets and tried to plot the data from each sheets using for in loop. I already succeeded creating two plots from these two sheets using this code below. The problem is I also want to automatically…
1
vote
1 answer

Why does the upper table overlap the lower figure-lines?

Question is a figure & table together from different axes. On the one hand, its fine in figure window shows below, after constrained_layout=True is added: On the other hand, the lower-lines and upper-table overlapped after save it to picture.…
Sean.H
  • 640
  • 1
  • 6
  • 18
0
votes
2 answers

How can I correctly save plots with a tkinter app plot function?

I am saving my plot using matplotlib.pyplot.savefig, but the resulting figure sometimes has bugs in it. These bugs are different in each image and can be the image with a transparent background, a fully transparent image, a fully white image or…
Rauf
  • 19
  • 3
0
votes
0 answers

matplotlib's function savefig() is not saving the hover event annotations used with mpl_connect()

Issue: The mouse hover annotation display effect of bars is not working in saved image "foo.png" by plt.savefig('foo.png'). The savefig() function saving the plot as a static image without mouse hover annotation display effect of bars in…
user3603533
  • 63
  • 1
  • 1
  • 4
0
votes
1 answer

Wrong image size when using Matplotlib savefig

I use savefig from Matplotlib to get an Image from a figure, and this image is modified with PIL after that. I also want to remove every padding. My problem is that the final size of the image is smaller than expected. For example: Size = (8,…
Nicolas
  • 1,812
  • 3
  • 19
  • 43
0
votes
0 answers

How to save charts without cutting off x-axis labels?

Could you please help me correctly save chart images? The saved files has axes x-titles that are cut off? See below: Current Chart Image I'm currently using: ax.figure.set_size_inches(16, 9) #adjusting the tick…
EvilRick
  • 1
  • 1
0
votes
0 answers

The way to save figures with ppi using python

I am struggling with saving figures with ppi. I know how to save figs with dpi and set figure size but have no idea with ppi. When I search, I could know the dictionary definition but not related to setting codes. If I want to set the figure size as…
Joe
  • 1
  • 1
0
votes
2 answers

plots to folder python

I am having issue saving plots to a folder. I want to store all of the plots created in a for loop to a folder that I previously created. I tried using imsave() function as follows: for p in samples: fig, ax = plt.subplots(1, 1) …
barista
  • 35
  • 5
0
votes
0 answers

Saving a normal Plot (not using Matplotlib)

To use a graph I want to save a plot at the highest quality. When I use plt.savefig(), the image is blank. I've the code and output (now a screenshot) below. I want to use it in my thesis so the quality needs to be high. Code: df = data[[ 'acq_cc',…
0
votes
2 answers

Matplot SavFig Returns Blank Image

I am trying to download some plots as images and these are being downloaded as blank images. The direct download works but the download through the drive shows blank images. ANY HELP WOULD BE HIGHLY APPRECIATED PLEASE. If I try to directly download…
Sehr Malik
  • 11
  • 2
0
votes
0 answers

How do I get rid of background whitespace when saving a matplotlib table?

I have searched stack overflow extensively for a solution to my problem and have had no luck finding an answer. I am trying to save a matplotlib table as a png image with no whitespace background in the saved table image. the png image of the table…
Matt
  • 1
0
votes
1 answer

How to save figure in matplotlib ajusted to the object size?

Hello everyone I am trying to save the figures from matplotlib. It saves with blank spaces around the figure, I mean It adds space, It is no saved with ajusted object size. It is very easy to edit them in Inkscape (I make that in this software), but…
Miguel
  • 55
  • 6
0
votes
0 answers

why python saves graph partially in high dpi?

I need to save a graph with high resolution by: plt.savefig('trace', format='jpeg', bbox_inches='tight', dpi=3000) The main graph is: But it saves partially, like this: How can I solve this problem?
Nasrin
  • 13
  • 5
0
votes
2 answers

Matplotlib save very long plot in single image Python

I'm trying to save a very long EEG line plot (>100 hours with a datapoint every 5min) as a single image with a resolution ~10x10000px so that it would be readable by human eye when zoomed in. I tried using figsize=(10000,10) but this just gives me…