Graphics, Figures & TablesSurface Plots from Matlab

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
internetmanden
Posts: 1
Joined: Sun Jul 07, 2013 8:09 pm

Surface Plots from Matlab

Post by internetmanden »

I have a problem with making a properly looking figure of a surface plot from Matlab. I save the figure as PDF (or EPS and use the epstopdf package) and then I use {figure} environment. However, when I compile it to a PDF document, the figure looks bad, as if there is too much vectorized graphics at once or something like that. If I save it as PNG it works fine, but PNG does not come out very nice when they are scaled. I use MiKTeX 2.9 and TeXstudio.

Can anyone help me with this issue?

Thank you very much!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Surface Plots from Matlab

Post by Johannes_B »

Nobody is able to help you right now. What makes a figure look bad? Can you at least give the compiled PDF or a screenshot? Also good would be a compilable minimal working example. That means you might need to upload one (or maybe more) of your graphics to make everything comprehensible and reproducible.


Welcome to the board
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
feuersaenger
Posts: 34
Joined: Sun Oct 16, 2011 5:56 pm

Re: Surface Plots from Matlab

Post by feuersaenger »

Hi,

if I am not mistaken, there are a couple of different ways to generate an eps export from matlab - and not all of them are good ways.

The preferred way would be to plot your surface as usual in matlab, then type "print -depsc <filename>" . I believe that this command accepts a sampling resolution as well (like -r600 or something like that).

The result should be a good input for converters to pdf.

You may also be interested in http://www.mathworks.com/matlabcentral/ ... atlab2tikz which has a different way of integrating graphics from matlab into TeX: it reimplements the graphics using pgfplots. The font quality, consistency, size, and general appearance is typically better, albeit at a higher runtime cost and limited feature scope (pgfplots cannot do all that matlab can). Details in the link above and in the pgfplots manual (http://pgfplots.sourceforge.net/)
Post Reply