How to add bar above a letter in xlabel
597 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
cvbnm
il 18 Nov 2017
Commentato: Walter Roberson
il 24 Giu 2021
I want to add a bar above the letter U (i.e. a horizontal line above the letter). Why will Matlab not accept xlabel('\bar{U}','Interpreter','Latex')? The output is Warning: Error updating Text.
Character vector must have valid interpreter syntax:
\bar{U}
Is it because there is no bar command in Matlab?
0 Commenti
Risposta accettata
Walter Roberson
il 18 Nov 2017
xlabel('$\bar{U}$','Interpreter','Latex')
6 Commenti
Oscar Espinosa
il 1 Giu 2020
But if I have text before the bar, doesn't work. There is another method?
I tried this:
zlabel('Относительный силовой фактор $\bar{G}$','Interpreter','Latex')
Walter Roberson
il 1 Giu 2020
you cannot use Unicode with Latex.
Unfortunately at this time I do not seem to be able to get \bar or \overline or \stackrel to work with Interpreter tex
Più risposte (1)
Léo
il 24 Giu 2021
Hi,
I have the same problem than Oscar. I want to put some text before and after putting the letter with the bar.
In my case, I have ylabel('Average concentration of species j (Cbar_j) [mol/m^3]'). If anyone has a clue for me I would be greatfull.
Thanks in advance.
5 Commenti
Léo
il 24 Giu 2021
Thank you so much.
I had no idea you could do so much playing with both matlab and latex
Walter Roberson
il 24 Giu 2021
Unfortunately fonts in math mode are somewhat restricted in pure LateX, and MATLAB does not support the use of \usepackage that might permit much more extensive customization.
Vedere anche
Categorie
Scopri di più su Labels and Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!