MATLAB Figure and LATEX

22 次查看(过去 30 天)
Brave A
Brave A 2021-3-7
Hi,
I produced some figures using MATLAB but when I add them into (Latex documnet) , it looks very small. I tried to increase font for text and legend but the problem still the there.
I attached one example figure. Thanks in advance!
  4 个评论
Star Strider
Star Strider 2021-3-7
I have no recent experience with preparing LaTeX documents, so unfortunately, no.
I’m hoping that someone with relevant experience will see this and can help you solve this. Perhaps posting an image of the document, or uploading the document itself (probably as a .zip file if the native file format isn’t supported on MATLAB Answers) would be helpful.

请先登录,再进行评论。

回答(1 个)

Jorg Woehl
Jorg Woehl 2021-3-7
I'm not sure what the issue is, but your figure displays just fine when I save it to a png file (my preferred graphics file format) and then insert it into a LaTeX document. Here is a minimal working example:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics[scale=0.25]{test.png}
\caption{your caption text}
\end{figure}
\end{document}
I usually scale figures down by 50%, but that wasn't quite enough in this case.
The output on a letter-size page is shown below (produced using Overleaf, by the way):
  2 个评论
Brave A
Brave A 2021-3-7
Do you have latex code for subfigures?
I added them but they are overlapping. Also in your example the picture not show everything.
Jorg Woehl
Jorg Woehl 2021-3-7
What do you mean exactly by "not showing everything"? As far as I can tell, everything is there from your original figure: axis labels, ticks and tick marks, grid, legend, data points and plots...
If you want to insert a picture of the entire figure window (with menu bar etc.), you would need to take a screenshot and insert that into your LaTeX document.
I am not sure if LaTeX can handle subfigures; my suggestion would be to first make a composite figure either in MATLAB itself (use subplot or tiledlayout) or an external drawing app, and insert this into your LaTeX document.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by