Use PdfPages
to solve your problem. Pass your figure
object to the savefig
method.
For example, if you have a whole pile of figure
objects open and you want to save them into a multi-page PDF, you might do:
import matplotlib.backends.backend_pdf
pdf = matplotlib.backends.backend_pdf.PdfPages("output.pdf")
for fig in xrange(1, figure().number): ## will open an empty extra figure :(
pdf.savefig( fig )
pdf.close()
Related Contents:
- Purpose of “%matplotlib inline”
- In Matplotlib, what does the argument mean in fig.add_subplot(111)?
- How to remove axis, legends, and white padding
- How to change the figure size of a seaborn axes or figure level plot
- How to invert the x or y axis
- Plot a horizontal line on a given plot
- matplotlib: how to draw a rectangle on image
- How to equalize the scales of x-axis and y-axis in matplotlib
- Plot yerr/xerr as shaded region rather than error bars
- Putting text in top left corner of matplotlib plot
- Plt.show shows full graph but savefig is cropping the image
- Matplotlib Legends not working
- sklearn plot confusion matrix with labels
- How to plot two columns of a pandas data frame using points
- matplotlib (equal unit length): with ‘equal’ aspect ratio z-axis is not equal to x- and y-
- matplotlib share x axis but don’t show x axis tick labels for both, just one
- ‘invalid value encountered in double_scalars’ warning, possibly numpy
- How to change backends in matplotlib / Python
- Change line width of lines in matplotlib pyplot legend [duplicate]
- How do I set the figure title and axes labels font size?
- why is plotting with Matplotlib so slow?
- matplotlib: Group boxplots
- How to get color of most recent plotted line in Python’s plt
- How to put legend outside the plot with pandas
- Python equivalent to ‘hold on’ in Matlab
- matplotlib colorbar in each subplot
- how to extract a subset of a colormap as a new colormap in matplotlib?
- Show only certain items in legend
- How to make an axes occupy multiple subplots with pyplot
- Bar-Plot with two bars and two y-axis
- Fine control over the font size in Seaborn plots
- Writing numerical values on the plot with Matplotlib
- How to plot a single point in matplotlib
- scatter plot logarithmic scale
- seaborn color_palette as matplotlib colormap
- Axes from plt.subplots() is a “numpy.ndarray” object and has no attribute “plot”
- Extract matplotlib colormap in hex-format
- Save matplotlib file to a directory
- Get legend as a separate picture in Matplotlib
- Matplotlib: How to plot images instead of points?
- Matplotlib: how to show legend elements horizontally?
- plotting results of hierarchical clustering on top of a matrix of data
- 3d axes ticks, labels, and LaTeX
- Adjusting gridlines and ticks in matplotlib imshow
- How does one insert statistical annotations (stars or p-values)
- matplotlib: change title and colorbar text and tick colors
- Difference between plt.draw() and plt.show() in matplotlib
- Putting arrowheads on vectors in a 3d plot
- How to create a stacked bar chart for my DataFrame using seaborn [duplicate]
- Python: subplot within a loop: first panel appears in wrong position