On 16/12/11 01:41, cpblpublic+usenet@...155... wrote:
Matplotlib produces pdf figures whose bounding boxes do not enclose all of the contents of the figure (or, usually, are too big).
I thought inkscape could easily solve this problem with:
inkscape -f matplotlibOutput.pdf --verb=FitCanvasToDrawing -A prettyfigure.pdf
But that leaves the pdf unchanged. Have I made a basic error?
Try this:
$ cp matplotlibOutput.pdf prettyfigure.pdf $ inkscape -f prettyfigure.pdf.pdf \ --verb=FitCanvasToDrawing \ --verb=FileSave \ --verb=FileQuit
Note: when using verbs on the command line, the GUI cannot be suppressed [1] (limits the usefulness of verbs for scripting or when trying to run Inkscape on a web server as conversion tool): you will need to press some buttons for commands that have options: 1 - Importing (aka opening) a PDF needs a confirmation in the import options dialog 2 - Exporting (saving as PDF) also requires a confirmation in the export options dialog 3 - The warning that you saved in a lossy format makes more sense when working with the GUI right from the beginning. I'm not aware of a setting to turn that warning off.
hth, ~suv
[1] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/CommandLine.html