MATLAB Answers

Merve
1

How can I use greek symbols in plot labels?

Asked by Merve
on 4 Oct 2014
Latest activity Answered by Camilo Malagon Nieto on 23 May 2019
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?

  0 Comments

Sign in to comment.

2 Answers

Answer by Mischa Kim
on 4 Oct 2014
Edited by Mischa Kim
on 4 Oct 2014
 Accepted Answer

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 Comment

that totally works, thank you.

Sign in to comment.


Answer by Camilo Malagon Nieto on 23 May 2019

A good info of how to deal with the greek characters syntaxis can can be found at.

  0 Comments

Sign in to comment.