How can I use greek symbols in plot labels?

조회 수: 255 (최근 30일)
Merve
Merve 2014년 10월 4일
댓글: Walter Roberson 2021년 11월 21일
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?

채택된 답변

Mischa Kim
Mischa Kim 2014년 10월 4일
편집: Mischa Kim 2014년 10월 4일
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')

추가 답변 (2개)

Sehrish  Bibi
Sehrish Bibi 2021년 11월 21일
How to write beta symbol in matlab for labeling graphs
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 11월 21일
xlabel('$\beta$', 'interpreter', 'latex')
ylabel('\beta', 'interpreter', 'tex')

댓글을 달려면 로그인하십시오.


Camilo Malagon Nieto
Camilo Malagon Nieto 2019년 5월 23일
A good info of how to deal with the greek characters syntaxis can can be found at.

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by