How can I have 'angstrom square' as unit of y axis in a plot?
25 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need use 'angstrom square' as unit of y axis in a plot. I tried: >>ylabel('MSD (\AA^{2})','Interpreter','latex','Fontname','TimesNewRoman') but it did not work. The version of my Matlab is R2014a.
Thank you.
0 commentaires
Réponses (1)
Star Strider
le 29 Sep 2017
You forgot the dollar signs ($):
figure(1)
plot(rand(1,100), rand(1,100), 'pg')
ylabel('$MSD (\AA^{2})$','Interpreter','latex','Fontname','TimesNewRoman')
or:
ylabel('MSD ($\AA^{2}$)','Interpreter','latex','Fontname','TimesNewRoman')
Another option:
angsqr = [char(197) char(178)]
angsqr =
'Ų'
3 commentaires
Star Strider
le 30 Sep 2017
As always, my pleasure!
If my Answer solved your problem, please Accept it!
Eugenio
le 20 Mar 2023
Another option would be
angs = [char(197)];
ylabel(strcat( angs ,'^{n}') )
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
