Register to reply

MATLAB figure in LATEX

by Curl
Tags: figure, latex, matlab
Share this thread:
Curl
#1
Mar6-12, 11:25 PM
P: 757
I have a MATLAB figure I want to put in a document. I'm using MikTex and Texmaker. However in the past half hour I have not been able to get this to work using any format and I tried everything I found on google. If I try to use .eps/.pdf file, all the axis labels disappear. And .jpg is ugly. I don't know what else to try. Anyone know how to do this?
Phys.Org News Partner Science news on Phys.org
Sapphire talk enlivens guesswork over iPhone 6
Geneticists offer clues to better rice, tomato crops
UConn makes 3-D copies of antique instrument parts
chiro
#2
Mar7-12, 12:08 AM
P: 4,572
Quote Quote by Curl View Post
I have a MATLAB figure I want to put in a document. I'm using MikTex and Texmaker. However in the past half hour I have not been able to get this to work using any format and I tried everything I found on google. If I try to use .eps/.pdf file, all the axis labels disappear. And .jpg is ugly. I don't know what else to try. Anyone know how to do this?
Hey Curl.

I did a quick google and got this:

http://amath.colorado.edu/documentat...e/figures.html

It mentions at the very bottom of the page that you need to specify information that corresponds to the bounding box that is used for the image.

Maybe this is why your axis are getting cut off. Perhaps you could change the bounding box information so that your axis are not cropped out?
Curl
#3
Mar7-12, 01:01 AM
P: 757
Wow i tried it with TeXworks and it works. Any reason why it doesn't work with Texmaker? I'm using the same compiler (PDFLaTeX) on both apparently. Weird.

intwo
#4
Mar7-12, 11:02 AM
P: 107
MATLAB figure in LATEX

I had trouble using .jpg images, so I started saving my MATLAB plots as .png and everything worked fine. :)
Curl
#5
Mar8-12, 07:26 PM
P: 757
PNG is ugly unless you are looking at the picture at 100%.
Zarqon
#6
Mar9-12, 09:39 AM
P: 229
You want to keep the figure in a vector base format, such as eps.

When making figures with matlab for use in papers for example, I often use an image program as a middle step for formatting the figure. Adobe Illustrator works, but it costs money. A free open source program that also works pretty well is Inkscape, which is designed to deal with vector based graphics.

The typical procedure would be to save the matlab figure as eps, then use the import option in Inkscape. This allows you to ungroup the components in the matlab graph and format it as you wish, for example changing fonts or lineshapes/colors. Then save it as eps, just remember to set the boundry box to fit the image components.

Hope that helps.


Register to reply

Related Discussions
Matlab figure into latex Calculus & Beyond Homework 5
Eps figure in latex Engineering, Comp Sci, & Technology Homework 0
Inserting a Figure into a Latex Document Math & Science Software 4
LaTex figure and equations Math & Science Software 1
LaTex figure word wrapping Math & Science Software 2