Inserting MATLAB Figure in Latex: Solutions

In summary, the conversation discusses how to attach a MATLAB figure in Latex. The solution involves saving the figure as .eps and using the command \includegraphics to scale the figure down. The conversation also touches on different scaling options and the need for the package "graphicx" in the preamble.
  • #1
sara_87
763
0

Homework Statement



I am trying to attach a MATLAB figure in Latex

Homework Equations





The Attempt at a Solution



I saved the graph as .eps instead of .fig, then i opened ghostscript, and saw that the figure was too wide to fit on the page...
how can i mend this?

thank you
 
Physics news on Phys.org
  • #2
There is the command \includegraphics[scale=0.5]{picture.eps}
Where is this case you have scaled the picture down by half.
 
  • #3
You also need \usepackacage{graphicx} in the preamble
 
  • #4
awesome :)

what if i need it even a bit smaller?
would i put scale=0.75?
or scale=0.25?

thanks
 
  • #5
i fixed it...
thank you
 
  • #6
scale=1 means the same shape, scale=0.5 os 50% reduced. scale=0.25 is 25% of the original scale etc...
 

1. How do I insert a MATLAB figure in Latex?

To insert a MATLAB figure in Latex, you can use the \includegraphics command. First, export your figure from MATLAB as a .eps or .pdf file. Then, in your Latex document, use the command \includegraphics{filename} to insert the figure in the desired location.

2. How can I resize the MATLAB figure in Latex?

You can resize the figure by adding the optional arguments [width= ] and [height= ] to the \includegraphics command. For example, \includegraphics[width=0.5\linewidth]{filename} will resize the figure to half of the document's line width.

3. Can I change the font size and style of the figure's labels in Latex?

Yes, you can change the font size and style of the figure's labels in Latex by using the \set command. For example, \set{\small\textit{Label}} will change the label to small and italicized.

4. How can I add a caption to the MATLAB figure in Latex?

To add a caption to the figure, you can use the \caption command. This should be placed after the \includegraphics command and before the \label command. For example, \caption{Caption text} will add a caption to the figure.

5. Is it possible to reference a MATLAB figure in Latex?

Yes, you can reference a MATLAB figure in Latex by using the \label and \ref commands. Place the \label command after the \caption command and then use \ref{labelname} to reference the figure in your text.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
2
Replies
36
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
Back
Top