savefig Questions

16

Solved

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'...
Heterochromatin asked 7/8, 2012 at 1:2

7

Solved

I'm trying to save a figure that works fine in IPython inline but does not save the figure to disk with the axes and titles included. I am using TKAgg backend by default in matplotlibrc. Any ideas ...
Lookin asked 24/10, 2013 at 20:46

26

Solved

This displays the figure in a GUI: import matplotlib.pyplot as plt plt.plot([1, 2, 3], [1, 4, 9]) plt.show() But how do I instead save the figure to a file (e.g. foo.png)?
Hui asked 8/3, 2012 at 17:38

13

Solved

In numpy/scipy I have an image stored in an array. I can display it, I want to save it using savefig without any borders, axes, labels, titles,... Just pure image, nothing else. I want to avoid pa...
Salk asked 21/11, 2011 at 21:13

1

I want to save a pipeline displayed with the set_config(display="diagram") command, see below: Is there a better way to do it than by taking a screenshot?
Treillage asked 14/1, 2022 at 17:2

2

Solved

I have a strange problem where if I save a figure, its labels and ticks will have a black background, see this example: plt.savefig("asdsadsad.png") I'm not even including any code here becaus...
Aquinas asked 11/12, 2018 at 15:51

6

I'm using pandas to generate a plot from a dataframe, which I would like to save to a file: dtf = pd.DataFrame.from_records(d,columns=h) fig = plt.figure() ax = dtf2.plot() ax = fig.add_subplot(ax...
Bowline asked 24/10, 2013 at 1:55

3

I need to use the "savefig" in Python to save the plot of each iteration of a while loop, and I want that the name i give to the figure contains a literal part and a numerical part. This ...
Menard asked 3/12, 2012 at 11:48

3

Solved

The following sample code will produce a basic line plot with no axes and save it as an SVG file: import matplotlib.pyplot as plt plt.axis('off') plt.plot([1,3,1,2,3]) plt.plot([3,1,1,2,1]) plt.sa...
Sailcloth asked 28/6, 2010 at 4:35

2

Solved

I'm fairly new to matplotlib and am limping along. That said, I haven't found an obvious answer to this question. I have a scatter plot I wanted colored by groups, and it looked like plotting via ...
Baecher asked 23/12, 2017 at 23:4

2

Solved

I'd like to obtain a spectrogram out of a wav file and then save it to a png, but I need just the content of the image (not axes or anything else). I came across these questions Matplotlib plots: r...
Monocoque asked 6/11, 2017 at 22:49

2

Solved

Is it possible to save (to a png) an individual subplot in a matplotlib figure? Let's say I have import pyplot.matplotlib as plt ax1 = plt.subplot(121) ax2 = plt.subplot(122) ax1.plot([1,2,3],[4,5...
Sharecrop asked 1/12, 2010 at 15:9
1

© 2022 - 2024 — McMap. All rights reserved.