How can I use greek symbols in plot labels?

697 views (last 30 days)
Merve
Merve on 4 Oct 2014
Commented: Walter Roberson on 21 Nov 2021 at 5:55
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?

Accepted Answer

Mischa Kim
Mischa Kim on 4 Oct 2014
Edited: Mischa Kim on 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')

More Answers (2)


Sehrish  Bibi
Sehrish Bibi on 21 Nov 2021 at 5:15
How to write beta symbol in matlab for labeling graphs
  1 Comment
Walter Roberson
Walter Roberson on 21 Nov 2021 at 5:55
xlabel('$\beta$', 'interpreter', 'latex')
ylabel('\beta', 'interpreter', 'tex')

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!