Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Troubles with exporting eps images

Subject: Troubles with exporting eps images

From: johnatan FM

Date: 16 Aug, 2008 11:00:20

Message: 1 of 7

I am writing my M.Sc. thesis with Latex and I need to
export many Matlab plots into eps files, in order to import
them in the tex file.
I am using Matlab version 7.5.0.342 (R2007b), since my
operating system is Vista.
Once obtained the desired plot, I use the Export Setup
window to make the eps file.
Without changing any option, but just clicking on "Apply to
figure" and then saving the exported file (as sugested by
the Matlab guide of this site), when I open the eps file
with GhostView, it appers just a part of the original
Matlab plot. When I tried to export the same plot with the
same exporting options, but in a different file format,
such as jpg, the exported file results to be perfect.
Since I need to have good quality images, I can not simply
export the plots into jpg files and then convert them into
eps ones and I would like to understand better how to work
this matter out.
Please, if anyone knows about this problem, answer me soon.

Pierluigi
Italy

Subject: Troubles with exporting eps images

From: Rune Allnor

Date: 16 Aug, 2008 11:24:01

Message: 2 of 7

On 16 Aug, 13:00, "johnatan FM" <pierluig...@virgilio.it> wrote:
> I am writing my M.Sc. thesis with Latex and I need to
> export many Matlab plots into eps files, in order to import
> them in the tex file.
> I am using Matlab version 7.5.0.342 (R2007b), since my
> operating system is Vista.
> Once obtained the desired plot, I use the Export Setup
> window to make the eps file.
> Without changing any option, but just clicking on "Apply to
> figure" and then saving the exported file (as sugested by
> the Matlab guide of this site), when I open the eps file
> with GhostView, it appers just a part of the original
> Matlab plot. When I tried to export the same plot with the
> same exporting options, but in a different file format,
> such as jpg, the exported file results to be perfect.
> Since I need to have good quality images, I can not simply
> export the plots into jpg files and then convert them into
> eps ones and I would like to understand better how to work
> this matter out.
> Please, if anyone knows about this problem, answer me soon.

You might want to skip EPS altogether and use PDFLaTeX
instead. You can print figures directly to PDF from
matlab, but you will need to manipulate the 'papersize'
property of the figure to reduce the displayed area
of the figure.

Rune

Subject: Troubles with exporting eps images

From: Derek O'Connor

Date: 18 Aug, 2008 15:02:01

Message: 3 of 7

"johnatan FM" <pierluigifm@virgilio.it> wrote in message
<g86c04$abh$1@fred.mathworks.com>...
> I am writing my M.Sc. thesis with Latex and I need to
> export many Matlab plots into eps files, in order to import
> them in the tex file.
> I am using Matlab version 7.5.0.342 (R2007b), since my
> operating system is Vista.
> Once obtained the desired plot, I use the Export Setup
> window to make the eps file.
> Without changing any option, but just clicking on "Apply to
> figure" and then saving the exported file (as sugested by
> the Matlab guide of this site), when I open the eps file
> with GhostView, it appers just a part of the original
> Matlab plot. When I tried to export the same plot with the
> same exporting options, but in a different file format,
> such as jpg, the exported file results to be perfect.
> Since I need to have good quality images, I can not simply
> export the plots into jpg files and then convert them into
> eps ones and I would like to understand better how to work
> this matter out.
> Please, if anyone knows about this problem, answer me soon.
>
> Pierluigi
> Italy



I think he reason for your problem is that Matlab is not
calculating a tight bounding box for the eps figure.

For example, I generated Test.fig using Matlab and in the
Test.fig window I simply used FILE, SAVE AS Test.eps.

Viewing this file in Ghostview/script shows that the
bounding box is not tight. Here is this file's preamble

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: MATLAB, The Mathworks, Inc. Version 7.5.0.342
(R2007b). Operating System: Microsoft Windows Vista.
%%Title: E:\000-MCS\NOTES\NA-BOOK-New\Zeno\Test.eps
%%CreationDate: 08/18/2008 14:58:16
%%DocumentNeededFonts: Helvetica
%%DocumentProcessColors: Cyan Magenta Yellow Black
%%LanguageLevel: 2
%%Pages: 1
%%BoundingBox: 87 262 507 578
%%EndComments

Still in Ghostview I used FILE, PS to EPS, saving the
converted file as TestGS.eps. Now the preamble is

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: MATLAB, The Mathworks, Inc. Version 7.5.0.342
(R2007b). Operating System: Microsoft Windows Vista.
%%Title: E:\000-MCS\NOTES\NA-BOOK-New\Zeno\Test.eps
%%CreationDate: 08/18/2008 14:58:16
%%DocumentNeededFonts: Helvetica
%%DocumentProcessColors: Cyan Magenta Yellow Black
%%LanguageLevel: 2
%%Pages: 1
%%BoundingBox: 114 273 474 560
%%EndComments

Notice that the bounding box has been changed.

I don't know enough about the innards of Matlab or
Ghostview/script to give an explanation or permanent fix for
this problem. I do wish Matlab would calculate tight
bounding boxes automatically.

Matlab 7.6.0.324 (R2008a) has the same problem.

Let me know if this solves your problem.

Best wishes

Derek O'Connor

Subject: Troubles with exporting eps images

From: Scott Seidman

Date: 18 Aug, 2008 15:18:21

Message: 4 of 7

"johnatan FM" <pierluigifm@virgilio.it> wrote in news:g86c04$abh$1
@fred.mathworks.com:

> I am writing my M.Sc. thesis with Latex and I need to
> export many Matlab plots into eps files, in order to import
> them in the tex file.
> I am using Matlab version 7.5.0.342 (R2007b), since my
> operating system is Vista.
> Once obtained the desired plot, I use the Export Setup
> window to make the eps file.
> Without changing any option, but just clicking on "Apply to
> figure" and then saving the exported file (as sugested by
> the Matlab guide of this site), when I open the eps file
> with GhostView, it appers just a part of the original
> Matlab plot. When I tried to export the same plot with the
> same exporting options, but in a different file format,
> such as jpg, the exported file results to be perfect.
> Since I need to have good quality images, I can not simply
> export the plots into jpg files and then convert them into
> eps ones and I would like to understand better how to work
> this matter out.
> Please, if anyone knows about this problem, answer me soon.
>
> Pierluigi
> Italy

I think WYSIWYG output has been a substantial matlab issue since Windows
3.1, at least. In most, if not all, of my other apps, I need do nothing
more than select all, copy, and paste to get flawless output into any app
I want it in-- not so with Matlab, and it has never been so.

Here's hoping the graphics team someday sees fit to pin this stuff down.





--
Scott
Reverse name to reply

Subject: Troubles with exporting eps images

From: Paul

Date: 19 Aug, 2008 01:42:03

Message: 5 of 7

Scott Seidman <namdiesttocs@mindspring.com> wrote in message
<Xns9AFE73028E8A1scottseidmanmindspri@130.133.1.4>...
> "johnatan FM" <pierluigifm@virgilio.it> wrote in
news:g86c04$abh$1
> @fred.mathworks.com:
>
> > I am writing my M.Sc. thesis with Latex and I need to
> > export many Matlab plots into eps files, in order to import
> > them in the tex file.
> > I am using Matlab version 7.5.0.342 (R2007b), since my
> > operating system is Vista.
> > Once obtained the desired plot, I use the Export Setup
> > window to make the eps file.
> > Without changing any option, but just clicking on "Apply to
> > figure" and then saving the exported file (as sugested by
> > the Matlab guide of this site), when I open the eps file
> > with GhostView, it appers just a part of the original
> > Matlab plot. When I tried to export the same plot with the
> > same exporting options, but in a different file format,
> > such as jpg, the exported file results to be perfect.
> > Since I need to have good quality images, I can not simply
> > export the plots into jpg files and then convert them into
> > eps ones and I would like to understand better how to work
> > this matter out.
> > Please, if anyone knows about this problem, answer me soon.
> >
> > Pierluigi
> > Italy
>
> I think WYSIWYG output has been a substantial matlab issue
since Windows
> 3.1, at least. In most, if not all, of my other apps, I
need do nothing
> more than select all, copy, and paste to get flawless
output into any app
> I want it in-- not so with Matlab, and it has never been so.
>
> Here's hoping the graphics team someday sees fit to pin
this stuff down.
>
>
>
>
>
> --
> Scott
> Reverse name to reply


I agree with your comments since I probably spend the same
amount of time in writing a script as compared to trying to
get the output in a publishable form.

WYSIWYG would be most welcome but Matlab seems reluctant to
act on this rather obvious weakness in the graphics output
(just review how many messages are posted on this topic!)


As we wait for a solution, I have found the following to be
a workable substitute. Expand the figure to fill the
screen, and then use the Print Screen option in Windows to
capture the image. Then paste the copy into an image
processor (Word in OK) and then edit out the Windows frame,
size it, etc. Now you can save it in any preferred format.
 The resolution will not be perfect but since most images
are reduced for publication, this is not an issue, at least
with my work.

Subject: Troubles with exporting eps images

From: NZTideMan

Date: 19 Aug, 2008 07:34:48

Message: 6 of 7

On Aug 19, 1:42=A0pm, "Paul " <p...@ceri.memphis.edu> wrote:
> Scott Seidman <namdiestt...@mindspring.com> wrote in message
>
> <Xns9AFE73028E8A1scottseidmanminds...@130.133.1.4>...
>
>
>
> > "johnatan FM" <pierluig...@virgilio.it> wrote in
> news:g86c04$abh$1
> > @fred.mathworks.com:
>
> > > I am writing my M.Sc. thesis with Latex and I need to
> > > export many Matlab plots into eps files, in order to import
> > > them in the tex file.
> > > I am using Matlab version 7.5.0.342 (R2007b), since my
> > > operating system is Vista.
> > > Once obtained the desired plot, I use the Export Setup
> > > window to make the eps file.
> > > Without changing any option, but just clicking on "Apply to
> > > figure" and then saving the exported file (as sugested by
> > > the Matlab guide of this site), when I open the eps file
> > > with GhostView, it appers just a part of the original
> > > Matlab plot. When I tried to export the same plot with the
> > > same exporting options, but in a different file format,
> > > such as jpg, the exported file results to be perfect.
> > > Since I need to have good quality images, I can not simply
> > > export the plots into jpg files and then convert them into
> > > eps ones and I would like to understand better how to work
> > > this matter out.
> > > Please, if anyone knows about this problem, answer me soon.
>
> > > Pierluigi
> > > Italy
>
> > I think WYSIWYG output has been a substantial matlab issue
> since Windows
> > 3.1, at least. =A0In most, if not all, of my other apps, I
> need do nothing
> > more than select all, copy, and paste to get flawless
>
> output into any app
>
> > I want it in-- not so with Matlab, and it has never been so.
>
> > Here's hoping the graphics team someday sees fit to pin
> this stuff down.
>
> > --
> > Scott
> > Reverse name to reply
>
> I agree with your comments since I probably spend the same
> amount of time in writing a script as compared to trying to
> get the output in a publishable form. =A0
>
> WYSIWYG would be most welcome but Matlab seems reluctant to
> act on this rather obvious weakness in the graphics output
> (just review how many messages are posted on this topic!)
>
> As we wait for a solution, I have found the following to be
> a workable substitute. =A0Expand the figure to fill the
> screen, and then use the Print Screen option in Windows to
> capture the image. =A0Then paste the copy into an image
> processor (Word in OK) and then edit out the Windows frame,
> size it, etc. =A0Now you can save it in any preferred format.
> =A0The resolution will not be perfect but since most images
> are reduced for publication, this is not an issue, at least
> with my work.- Hide quoted text -
>
> - Show quoted text -

I used to have problems using the export facility for eps as well, so
now I use print like this:
plotfile=3D[pth 'myplot'];
print('-depsc',plotfile)
and I have no problems whatsoever.

Subject: Troubles with exporting eps images

From: kkuilla

Date: 28 Aug, 2008 14:18:10

Message: 7 of 7

If you use the scale option in latex you will be able to see the
entire figure.

I maximise my figure window, either use File->Save As or I save the
file with the print command (print('-depsc',filename.eps) ). Then in
latex, use the scale option to \includegraphics, i.e

\includegraphics[scale=0.6]{your_graphics_file}

to shrink the image to fit on the page. You will not see the entire
figure in Ghostview but you will see it in your .dvi if you use the
scale option. If you need to print the figure from anything else but
Latex I open the eps into Coreldraw (or any other vector based
software) and then resize and save it again from there. It depends on
what you fancy.

I maximise the window and use very large fonts and lines (36pt and
3pt) so that it will look ok when I scale it down. It looks ugly on
screen but good in print.

HTH

Rgds /Sam

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us