%% print plots to pdfs; use pdfshuffler to cat or fix rotations filebasename='/home/ikilledsuperman/plot_%d.pdf' outputname='/home/ikilledsuperman/outputlogfile.pdf' m=length(findall(0,'type','figure')); filelist=cell(m,1); for n=1:1:m figure(n); set(n,'PaperUnits','normalized'); set(n,'PaperPosition', [0 0 1 1]); %fit to page filelist(n)=cellstr(sprintf(filebasename,n)); print(gcf, '-dpdf', sprintf(filebasename,n)); end delete(outputname) append_pdfs(outputname, filelist{:}); delete(filelist{:})As the comment says, pdfshuffler can be used to put the finishing touches on any generated pdfs. Close any unneeded figure windows with 'close all'. This script makes use of append_pdfs.
This is merely a record of stumbling attempts to solve various problems. Some worked well; most are inelegant half-assed clusterfucks. It is the observed rarity of concern or applicable solutions in web searches which ultimately drove me to the kind of madness as would precipitate a blog of my own meager conclusions. Somebody take these damn ideas and use them.
Wednesday, November 19, 2014
Matlab: Compile all open figures as a single pdf
As part of my network status log processing script, I needed a way to export weekly overview plots in a format that could be used to convey problems to other people at a glance. The larger body of the script is a block-mode kludge which does the actual log file processing and plotting in whatever manner I choose. The final block is a brief bit which rolls the current figure windows into a single pdf.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment