Prev: Plotting a network map
Next: where are images saved?
From: Randy on 27 Feb 2010 14:21 How does one export a PDF image in matlab in such a way that the PDF won't have extra white space? In other words, auto-crop the PDF so only the image appears and not an entire PDF page with the image in the center. I'm trying to import these images professionally into latex format however it's proving difficult when the images come with extra white space. Conversely, I realize that I could export the images to .EPS for latex usage, however I don't know how to export EPS images into PDF format from latex. Any assistance would be appreciated. Thanks!
From: Oskar Vivero on 27 Feb 2010 14:33 "Randy " <rfodish(a)hotmail.com> wrote in message <hmbrb0$60f$1(a)fred.mathworks.com>... > How does one export a PDF image in matlab in such a way that the PDF won't have extra white space? In other words, auto-crop the PDF so only the image appears and not an entire PDF page with the image in the center. > > I'm trying to import these images professionally into latex format however it's proving difficult when the images come with extra white space. > > Conversely, I realize that I could export the images to .EPS for latex usage, however I don't know how to export EPS images into PDF format from latex. > > Any assistance would be appreciated. Thanks! For cropping the image before you print it into a PDF or EPS you can try the following: set(gca,'Position',... get(gca,'OuterPosition') - ... get(gca,'TightInset') * ... [-1 0 1 0; 0 -1 0 1; 0 0 1 0; 0 0 0 1]) That will make the outer position of the figure the same size as the tight inset and all of the white space surrounding your figure will be gone. I don't know why you would want to export your .eps as .pdf from latex. If you typeset with DVI, latex should be able to produce a .ps file of your document. Then you can convert that .ps file into .pdf with a simple command. There are several other ways to do this, I recommend you to go and do some search on the latex documentation. You can also see the wiki on latex which is very informative. I hope this helps Oskar
From: Brian Borchers on 27 Feb 2010 14:38 On Feb 27, 12:21 pm, "Randy " <rfod...(a)hotmail.com> wrote: > How does one export a PDF image in matlab in such a way that the PDF won't have extra white space? In other words, auto-crop the PDF so only the image appears and not an entire PDF page with the image in the center. > > I'm trying to import these images professionally into latex format however it's proving difficult when the images come with extra white space. > I've encountered this problem in the past. For some reason the bounding box is set correctly in the .eps output but not in the .pdf output. The simplest approach that I've found is to use "print -deps" to produce a .eps file and then convert the .eps into PDF using some other utility. > Conversely, I realize that I could export the images to .EPS for latex usage, however I don't know how to export EPS images into PDF format from latex. Somewhere on the web I picked up a MATLAB function called "eps2pdf" that invokes ghostscript to do the eps to pdf conversion.
From: Rune Allnor on 27 Feb 2010 15:43 On 27 Feb, 20:21, "Randy " <rfod...(a)hotmail.com> wrote: > How does one export a PDF image in matlab in such a way that the PDF won't have extra white space? In other words, auto-crop the PDF so only the image appears and not an entire PDF page with the image in the center. > > I'm trying to import these images professionally into latex format however it's proving difficult when the images come with extra white space. > > Conversely, I realize that I could export the images to .EPS for latex usage, however I don't know how to export EPS images into PDF format from latex. If you want to use latex text in your matlab figures, EPS2PDF will not work. To export directly to PDF, do something like set(gcf,'paperunits',centimeters) set(gcf,'papersize',[10,7]) set(gcf,'paperposition',[0,0,10,7]) print -dpdf filename.pdf Rune
From: Bruno Luong on 28 Feb 2010 03:27
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <77d36a59-fe5a-4fed-ac2b-c392b7da8496(a)g10g2000yqh.googlegroups.com>... > > If you want to use latex text in your matlab figures, EPS2PDF > will not work. Huh? I do it for years, and I have not noticed anything that is not working. Bruno |