"In het verleden behaalde resultaten bieden geen garanties voor de toekomst"
About this blog

These are the ramblings of Matthijs Kooijman, concerning the software he hacks on, hobbies he has and occasionally his personal life.

Most content on this site is licensed under the WTFPL, version 2 (details).

Questions? Praise? Blame? Feel free to contact me.

My old blog (pre-2006) is also still available.

Sun Mon Tue Wed Thu Fri Sat
Powered by Blosxom &Perl onion
(With plugins: config, extensionless, hide, tagging, Markdown, macros, breadcrumbs, calendar, directorybrowse, entries_index, feedback, flavourdir, include, interpolate_fancy, listplugins, menu, pagetype, preview, seemore, storynum, storytitle, writeback_recent, moreentries)
Valid XHTML 1.0 Strict & CSS
/ Blog / Uni / BaRef
Exporting figures from Matlab to LaTeX

I've been struggling away on exporting figures generated by Matlab for use in LaTeX. First attempts using the "Save as..." dialog looked promising and even listed SVG. Unfotunately, trying that resulted in the cryptic error "the svg device option is only supported for simulink systems", while I was trying to export a simulink generated figure... Oh well...

After some fiddling around with the eps option and the File->Export options... menu, which also allows exporting to eps but with some more options, I did a few exports. Unfortunately, doing these by hand every time (File->Export Options, Load the settings, apply to figure, Zoom to the correct scale, press Export, type filename, select EPS, click save, click ok, close window) was a little too much for my commandline-oriented brain.

Looking around in the help found me the print function, which one can use as follows:

print -f1 -deps Filename.eps

This, as expected, prints figure 1 to Filename.eps in the (black and white) eps format. If you want to print another figure, say figure 3, use -f3. If you want to have coloured eps output, use -depsc instead.

The only thing that still needs to be done by hand is zooming the figure, if appropriate, and closing the window (but IIRC a close all command at the end will close all figure windows).

Now, let's get to actually putting my exported .eps figures into my paper!

Related stories
0 comments -:- permalink -:- 00:08
Copyright by Matthijs Kooijman - most content WTFPL