Reputation: 133
How can I added a note on a figure plot in Matlab which contain math symbols (kappa, gamma, alpha, symbol of containing, ...) as explained in the image:
Upvotes: 0
Views: 310
Reputation: 30045
You can add a text label using the text
command.
For example
plot(0:10, (0:10).^2);
% Add text at x=5, y=10
text(5, 10, 'this is text');
% Add text at x=5, y=50, with Greek letters
text(5, 50, '\pi is nice, \alpha is too');
This works because the interpreter is set to LaTeX by default. For the full list of supported TeX commands, see this list in the documentation. In particular, since you asked about Greek letters, here is a basic list. Most are as you would expect, preceded by a backslash:
Character Sequence Symbol
\alpha α
\beta β
\gamma γ
\delta δ
\epsilon ɛ
\zeta ζ
\eta η
\theta Θ
\kappa κ
\lambda λ
\mu µ
\xi ξ
\pi π
\rho ρ
\sigma σ
Notes on the LaTeX interpreter.
You can also render maths inside text captions (or axes labels, and chart titles) using $inline mode$ or $$display mode$$. See the linked docs for more details.
You can set the default interpreter to LaTeX (if for some reason it isn't) using
set(0,'defaulttextinterpreter','latex')
Upvotes: 1
Reputation: 1908
The default interpreter is already latex so all you have to do is something like this as an example. not the backslash
to access the latex commands. You will have to search what symbols you want on the internet.
legend('\rho = 0.5')
Upvotes: 0