How can I use greek symbols in plot labels?

65 vues (au cours des 30 derniers jours)
Merve
Merve le 4 Oct 2014
Hi,
I have a plot x axis of which is formed of an array like [ 20 25 30...]
But I want x-axis to appear like lambda/20 lambda/25 etc.
Could you please help me?
  2 commentaires
Getahun
Getahun le 3 Jan 2025
I am using matlab 2013. I want to list greek letters on y axis of the Bargraph in simulating Sensitivity Analysis of basic parameters in modeling. would you help me please?
Walter Roberson
Walter Roberson le 3 Jan 2025
I think you should be should be able to use ylabel or text specifying 'Interpreter', 'tex' and using TeX coding as described https://www.mathworks.com/help/matlab/creating_plots/greek-letters-and-special-characters-in-graph-text.html#bux4rpf

Connectez-vous pour commenter.

Réponse acceptée

Mischa Kim
Mischa Kim le 4 Oct 2014
Modifié(e) : Mischa Kim le 4 Oct 2014
Merve, you mean something like
lambda = 20:5:40;
y = 1./lambda;
plot(lambda,y)
xlabel('{\lambda}')
set(gca,...
'xtick',lambda,...
'xticklabel',{'l/20' 'l/25' 'l/30' 'l/35' 'l/40'},'fontname','symbol')
  1 commentaire
Merve
Merve le 4 Oct 2014
that totally works, thank you.

Connectez-vous pour commenter.

Plus de réponses (2)

Sehrish  Bibi
Sehrish Bibi le 21 Nov 2021
How to write beta symbol in matlab for labeling graphs
  1 commentaire
Walter Roberson
Walter Roberson le 21 Nov 2021
xlabel('$\beta$', 'interpreter', 'latex')
ylabel('\beta', 'interpreter', 'tex')

Connectez-vous pour commenter.


Camilo Malagon Nieto
Camilo Malagon Nieto le 23 Mai 2019
A good info of how to deal with the greek characters syntaxis can can be found at.

Catégories

En savoir plus sur Labels and Annotations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by