Archive

Archive for July 9, 2010

Exporting from MATLAB to eps

July 9, 2010 3 comments

I had some trouble today trying to convert one mesh figure to an eps file to use it in LaTex. First the face color in the mesh wasn’t properly set when I exported, MATLAB create some annoying margin around the eps file and the margins were not as tight as possible.

Any way I found good information in the web.  But I cannot finish my task automatically as I wanted. I will explain a little bit about how to publish a good figure in few steps.

First prepare your figure — do some plots –, and store the handler

h = figure(1);

Then,  — it is supposed to work, or you can use another method — you set the margins tight

iptsetpref('ImshowBorder','tight')

And for a good final look you need to set the background to other color that is different from the default gray

set(h,'Color','white')

This part is important if you are trying to change the faces color in a 3D plot, if you don’t change this value the faces are not rendered properly.
Now let’s print the figure to an eps file using -depsc2 driver and for a good result use a vector graphics output, using the painters render er

print(h,'-depsc2','-painters','figure.eps')

This should do the magic. Although, for me the margins wasn’t tight enough. I solve this problem by editing the eps file by hand. Open it with a text editor and change the lines (all of them)

%%BoundingBox: x-ll y-ll x-ur y-ur

where:

  1. x-ll is the x-coordinate of the lower-left corner of the BoundingBox.
  2. y-ll is the y-coordinate of the lower-left corner of the BoundingBox.
  3. x-ur is the x-coordinate of the upper-right corner of the BoundingBox.
  4. y-ur is the y-coordinate of the upper-right corner of the BoundingBox.

That make good figures. You can change the size of the paper too, and other properties before printing.

Categories: MATLAB, Tips Tags: , ,

Información a la mano

July 9, 2010 Leave a comment

Revisalo!!

Gracias al esfuerzo de dos compañeros que estan estudiando aca en KHU (Pablo y Maria :mrgreen: ), ahora tenemos un lugar donde se concentra la información de este proceso que iniciamos hace ya un año.

Para todos los que estan interesados y se preguntan como es el estar estudiando en Corea y que pasos hay que seguir, ésta guía es un buen inicio. Luego se podran dar cuenta que ahí mismo hay lugares para ampliar la información. Excelente iniciativa espero se pueda seguir nutriendo el sitio con más información y todo el feedback es bienvenido.

Follow

Get every new post delivered to your Inbox.