Get Rid of The White Space Around Matlab Figure's PDF Output - Stack Overflow

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

12/2/12

Get rid of the white space around matlab figure's pdf output - Stack Overflow
This is Google's cache of http://stackoverflow.com/questions/3801730/get-rid-of-the-white-space-around-matlab-figures-pdf-output. It is a snapshot of the page as it appeared on 24 Nov 2012 16:40:47 GMT. The current page could have changed in the meantime. Learn more Tip: To quickly find your search term on this page, press Ctrl+F or -F (Mac) and use the find bar. These search terms are highlighted: print matlab figure pdf command Text-only version

Get rid of the white space around matlab figure's pdf output

I'd like to use PDF versions of my matlab plots in a LaTeX document. I'm saving the figures using the "saveas" command with the PDF option but I get huge white space around my plots in the pdf files. Is this normal? How can I get rid of it? Automatically, of course, since I have "a lot" of plots.
pdf matlab

edited Sep 4 at 8:38 Bart 6,707 4 13 25

asked Sep 27 '10 at 7:07 mjbrown2 33 1 4

Same question: stackoverflow.com/questions/5150802/ Drazick May 20 '11 at 9:10

feedback

6 Answers
Here is a less painful solution than Tobin's: http://tipstrickshowtos.blogspot.com/2010/08/how-to-get-ridof-white-margin-in.html
answered Sep 27 '10 at 18:54 emrea 580 2 6 feedback

I suffered a bit with regards to this b4 finding an easy answer. Save as a .eps, and then convert the .eps to .pdf. In Mac OS this can be done in Preview.
answered yesterday anon55 31 1 feedback

Exporting Figures for Publication is a good starting point. Instead of d e p s use d p d f for pdf output.
webcache.googleusercontent.com/search?q=cache:f6e2JP9pFVEJ:stackoverflow.com/questions/380 1/2

12/2/12

Get rid of the white space around matlab figure's pdf output - Stack Overflow

EDIT: I wasn't aware of the bounding box issue with pdf. But Tobin solved it. s e t ( g c f ,' P a p e r S i z e ' ,[ 6 . 2 57 . 5 ] ) ; s e t ( g c f ,' P a p e r P o s i t i o n M o d e ' ,' m a n u a l ' ) ; s e t ( g c f ,' P a p e r P o s i t i o n ' ,[ 006 . 2 57 . 5 ] ) ; s e t ( g c f ,' P a p e r U n i t s ' ,' i n c h e s ' ) ; s e t ( g c f ,' P a p e r S i z e ' ,[ 6 . 2 57 . 5 ] ) ; s e t ( g c f ,' P a p e r P o s i t i o n M o d e ' ,' m a n u a l ' ) ; s e t ( g c f ,' P a p e r P o s i t i o n ' ,[ 006 . 2 57 . 5 ] ) ; s e t ( g c f ,' r e n d e r e r ' ,' p a i n t e r s ' ) ; p r i n t ( g c f ,' d p d f ' ,' m y f i g u r e . p d f ' ) ; p r i n t ( g c f ,' d p n g ' ,' m y f i g u r e . p n g ' ) ; p r i n t ( g c f ,' d e p s c 2 ' ,' m y f i g u r e . e p s ' ) ;
edited Sep 27 '10 at 7:58 answered Sep 27 '10 at 7:38 zellus 6,033 2 13 24

feedback

In addition to the other suggestions here, you might also try to use the LooseInset property as described in http://UndocumentedMatlab.com/blog/axes-looseinset-property/ to remove extra space around your plot axes.
answered Sep 27 '10 at 22:07 Yair Altman 2,916 6 17 Was this post useful to you? Yes No

This works for displaying purposes: s e t ( g c a ,' L o o s e I n s e t ' ,g e t ( g c a ,' T i g h t I n s e t ' ) ) ; Should work for printing as well.
answered May 20 '11 at 9:21 Drazick 584 5 15 feedback

If you have inkscape installed, and might not have the time to re-simulate all your graphs, inkscape offers a command -line interface that will get rid of the whitespace (a quick Google search should result in the actual command needed)
edited Sep 4 at 8:37 Bart 6,707 4 13 25 answered Sep 4 at 8:24 Simon

You might want to include the actual command needed when you answer a question. Bart Sep 4 at 8:38

feedback

Not the answer you're looking for? Browse other questions tagged pdf matlab or ask your own question.

webcache.googleusercontent.com/search?q=cache:f6e2JP9pFVEJ:stackoverflow.com/questions/380

2/2

You might also like