From: matthew a. <ma...@ca...> - 2004-01-15 23:53:57
|
Hi, Currently matplotlib outputs postscript graphs which have no bounding box set. This means that by default they fill the whole page. If you want to include several plots in the same page in a document (because you generated them separately, or because the subplot output is a bit messy) then you have to manually crop each postscript graph. (Atleast that is my experience with LaTeX via lyx, Word is presumably similar.) I tried a few tools to fix this. I finally found bbfig: http://rpmfind.net/linux/RPM/contrib/noarch/noarch/bbfig-1.14-2.noarch.html which correctly calculates the bounding box for an arbitrary postscript file. As hinted by this page: http://www.mcs.kent.edu/mcsinfo/compsys/faq/cmds/bbfig.html you can do bbfig yourfile.ps | ghostview - to see the bounding box visually. But /usr/doc/bbfig-1.14/README.RPM says you can also do bbfig myfigure.ps | gs -q -dNODISPLAY - then add it output to the top of the ps file to have it be correctly cropped. bbfig is coded in postscript! But I thought you might be interested in case you want to fix matplotlib so that it outputs correctly bounded (e)ps files by default. Cheers, Matthew. |