Tilde character underneath a letter in Matlab charts

8 visualizaciones (últimos 30 días)
I am trying to put a tilde underneath a letter in my ylabel on a chart in Matlab. I am using interpreter and latex to do it and i know the way to do it in Latex is \utilde. But Matlab does not seem to recognise this command, it does recognise \tilde, however.
Has anyone tried to put a character underneath a letter in Matlab for chart plots? How can I do this?!
Thanks!
Olivia

Respuesta aceptada

Abhisek Pradhan
Abhisek Pradhan el 17 de Oct. de 2019
The following code may be able to help you.
ylabel('$\stackrel{a}{\tilde{}}$','Interpreter','latex');
  3 comentarios
Abhisek Pradhan
Abhisek Pradhan el 18 de Oct. de 2019
Is this what are you looking for
ylabel('$\stackrel{a}{\tilde{}}$','Interpreter','latex','FontSize',60);
set(get(gca,'ylabel'),'rotation',0);
Olivia Milton-thompson
Olivia Milton-thompson el 18 de Oct. de 2019
Editada: Olivia Milton-thompson el 18 de Oct. de 2019
No that second one is definitely not what I wanted, I don't want to rotate the axis or make the font bigger haha, just wanted a normal letter with a tilde underneath, not a superscript with a tilde underneath. But...
Your first answer has worked I think, just not in the way I expected it to and I'm not sure why it worked haha. Initially when I used your first code above, it just gave what it shows on the attachment (capture), with the a and tilde as a superscript. But I wanted to have it as a normal a with a tilde underneath, not a superscript.
But then I decided to just try and complete what I wanted to do using your original line of code and for some reason it worked, shown on the attachment (capture2). I needed the tilde underneath the i and it's done it. Does not make much sense to me as to why stackrel worked in this case and didnt keep it as a superscript, but that's fine, it's worked! Thanks!

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 18 de Oct. de 2019
If you do not need latex then use 'a' followed by U+0330. Unicode can be used for interpreter none or tex
  5 comentarios
Walter Roberson
Walter Roberson el 18 de Oct. de 2019
It works for me on Mac, R2019b. Which release and OS are you using?
Example of incorporating text and variables:
autilde =['a' hex2dec('0330')];
iter = 17;
ylabel( sprintf('%s%s%d', 'experiment #', autilde, iter))
Olivia Milton-thompson
Olivia Milton-thompson el 20 de Oct. de 2019
Still can't see any tilde, sadly!
Using your code above, I get the picture shown on the attachment.
I'm using Windows, R2019a, so shouldnt be too wildly different to you!

Iniciar sesión para comentar.

Categorías

Más información sobre Entering Commands en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by