How does one put an accent on a symbol in plots?

45 views (last 30 days)
Hi,
I'd like to insert symbols like 'hat', 'dot', 'bar', 'arrow', etc over text symbols in plots. Could someone let me know how this is done in Matlab 2014b in the figure window?
Thanks.

Accepted Answer

Star Strider
Star Strider on 5 Mar 2015
You have to set the 'Interpreter','latex' option, and use the appropriate LaTeX syntax. For details on using LaTeX, see The (Not So) Short Introduction to LaTeX2e. See the full LaTeX Documentation for details on other guides.
  4 Comments
Sai S. Prakash
Sai S. Prakash on 6 Mar 2015
Thanks. Could you show the last two lines in 'tex' and not 'latex' just for understanding? Could you please also include an example for title and ylabel?
Star Strider
Star Strider on 6 Mar 2015
Edited: Star Strider on 6 Mar 2015
My pleasure.
It’s not possible to put the dot (or hat or anything else) over the variables in TeX. That’s the reason it’s necessary to use LaTeX.
The title, xlabel, and ylabel would work the same way as the legend in my example. They’re all controlled by Text Properties.
The LaTeX syntax requires a bit of experimentation to learn how it works and how to use it effectively, just like MATLAB itself or any other language. (I have to refer to the documentation I linked to earlier every time I use LaTeX because I don’t use it that often.)
EDIT In The (Not So) Short Introduction to LaTeX2e, see Section 3.10, page 75, and Table 2.2 on page 25.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!