MATLAB Figure and LATEX

22 vues (au cours des 30 derniers jours)
Brave A
Brave A le 7 Mar 2021
Commenté : Jorg Woehl le 7 Mar 2021
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 commentaires
Brave A
Brave A le 7 Mar 2021
Any thoghts?
Star Strider
Star Strider le 7 Mar 2021
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.

Connectez-vous pour commenter.

Réponses (1)

Jorg Woehl
Jorg Woehl le 7 Mar 2021
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 commentaires
Brave A
Brave A le 7 Mar 2021
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 le 7 Mar 2021
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Printing and Saving dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by