4

I have some Matlab code that produces some diagrams. All I want to do, is to import these diagrams into TeXmaker. In which format do I have to save these diagrams and what packages do I need for this purpose?

  • 1
    The best option is to export it as eps or pdf. Then you can include it in tex file using graphicx package. – Sigur Dec 29 '13 at 14:33
  • 1
    I prefer PDF, but as the PDF export from Matlab sucks big time, an extra step should be taken. See tex.stackexchange.com/questions/5559, tex.stackexchange.com/questions/3995 or tex.stackexchange.com/questions/34386. – Torbjørn T. Dec 29 '13 at 15:28
  • 1
    How about exporting the figure using matlab2tikz, and include the exported code in as a tikzpicture in LaTeX? – Herr K. Dec 29 '13 at 18:10
  • I usually export from GIMP as png but I don't know if that's an option for MatLab. (On OS X, exporting as pdf worked at least as well, but on Linux exporting as png generally works better.) png has considerable advantages if I'm planning to use an image in beamer, for example, because the support for transparency is better. – cfr Dec 29 '13 at 23:33
  • 1
    @cfr Yes, one can export as PNG from Matlab, but you generally don't want that, as PNG is a raster format, while EPS and PDF are vector formats. – Torbjørn T. Dec 30 '13 at 11:42
0

You will want to export images in EPS format and use graphicx package to include them in your TeX document. If you need to make labels and and add formulas to your images you will need PSfrag package.

-1

I use Sage math for Ubuntu and the both may have one or more things in common. Generate an EPS and a PDF format for the same diagram and then use the \includegraphics in the file.tex. But in Sage though you don't need any command it does it for you.

  • 1
    I had hard time refraining from down voting your answer. The guy is asking about MATLAB and out of nowhere you start talking about Sage. – Predrag Punosevac Dec 31 '13 at 22:33
  • My bad. But I have both softwares and they are pretty much similar. I didn't try your answer though – Xrobot Jan 8 '14 at 8:51
  • There is no similarity between Sage and MATLAB! You probably want to refrain from posting invalid statements on the Internet. You never know when that can hurt you. – Predrag Punosevac Jan 9 '14 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.