MATLAB Figure and LATEX

조회 수: 24 (최근 30일)
Brave A
Brave A 2021년 3월 7일
댓글: Jorg Woehl 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
Brave A
Brave A 2021년 3월 7일
Any thoghts?
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