sqrt in figure label

how would i place a square root sign inside a figure axis label? someting like square root of X

Réponses (1)

Amith Kamath
Amith Kamath le 17 Nov 2011

4 votes

you would have to change the interpreter to latex, and then type in {\surd} in the xlabel (or any text) box. All the symbols are latex compatible, which is great, and you can make plots like this:

3 commentaires

Baba
Baba le 18 Nov 2011
isn't working for me
Amith Kamath
Amith Kamath le 18 Nov 2011
oops! I did a Rick Perry there! :) The latex symbol for square root is \surd and not \sqrt. This should definitely work. Sorry for the slip-up! Try this:
plot([1:1:10])
title('{\itAe}^{-\alpha\itt}sin\beta{\itt} {\surd} \alpha<<\beta')
xlabel('Time \musec.')
ylabel('Amplitude')
Daan
Daan le 28 Nov 2023
For any future person reading this: the Latex interpreter needs the string to be in 'Math'-text.
i.e. should be enclosed in $[text]$
Solutions:
xlabel('$\sqrt{x}$ [-]',Interpreter='latex')
or:
xlabel('$\surd$ x [-]',Interpreter='latex')

Connectez-vous pour commenter.

Catégories

En savoir plus sur Labels and Annotations dans Centre d'aide et File Exchange

Question posée :

le 17 Nov 2011

Commenté :

le 28 Nov 2023

Community Treasure Hunt

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

Start Hunting!

Translated by