1

This is my first time trying to import plots created by MATLAB into LaTeX and it's not turning out very nicely. I have saved my MATLAB plot as a .png file here and an .eps file here. Using the .eps file, I have the following code:

\documentclass[twoside, a4paper, 12pt]{article}
\usepackage{graphicx}    
\begin{document}

\begin{center}
   \includegraphics[scale=0.6]{graph2.eps}
\end{center}


\end{document}

which turns out to look like: (half the image is missing)

enter image description here

So then I changed the scale to 0.4:

 \includegraphics[scale=0.4]{graph2.eps}

which produces the output:

enter image description here

However now the image is way too small to be eligible (and it doesn't feel like it's centered properly). Does anyone have a good solution for this? How can I get the image to look "good" when imported into LaTeX? Thanks.

EDIT:

I have saved the three plots separately:

The first graph is called g1 and can be found here

g2 can be found here

and g3 can be found here

How can I combine them into one figure using the tabular environment? Could someone provide a template code?

TrueTears
  • 1,617
  • 1
    Just a tip: You need to crop the image to get rid of white space. For this task you could use ImageMagick/GraphicsMagick/GIMP (png file) or eps->pdf conversion supported by the pdfcrop tool (pdf file) and eventually back to eps file. – Malipivo Apr 12 '14 at 08:16
  • 4
    Personally, I use matlab2tikz and it works perfectly. – Claudio Fiandrino Apr 12 '14 at 08:19
  • For what it's worth, it might also be a good idea to export these three graphs separately (and maybe the legend as well, or attach it to every graph), then you are slightly more flexible in positioning the images. – moewe Apr 12 '14 at 08:19
  • I recommend moewe's suggestion and inclusion of the separate images in a tabular environment to align them? –  Apr 12 '14 at 08:37
  • Thanks. I have edited my post where I saved each graph separately. Could you please provide a template code utilizing the tabular environment to align them? – TrueTears Apr 12 '14 at 08:55
  • 1
    Tip: use width= option instead of scale when importing graphics. This scales graphics to desired sizes. Eg, \includegraphics[width=\textwidth]{graph2.eps}. – Igor Kotelnikov Apr 12 '14 at 09:29
  • @moewe The pics are gone. Do you know a good question that might suit as a duplicate? Or do you wanna write an answer? – Johannes_B Oct 05 '15 at 20:57
  • 4
    @Johannes_B Take your pick: http://tex.stackexchange.com/q/148438/35864, http://tex.stackexchange.com/q/5769/35864, http://tex.stackexchange.com/q/37581/35864, http://tex.stackexchange.com/q/65386/35864, http://tex.stackexchange.com/q/10245/35864. Maybe there is something better and more specific out there, but those are the questions a short search turned up. – moewe Oct 06 '15 at 05:48

0 Answers0