How can I use greek symbols in plot labels?

174 ビュー (過去 30 日間)
Merve
Merve 2014 年 10 月 4 日
コメント済み: Walter Roberson 2025 年 1 月 3 日
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 件のコメント
Getahun
Getahun 2025 年 1 月 3 日
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 2025 年 1 月 3 日
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

サインインしてコメントする。

採用された回答

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')
  1 件のコメント
Merve
Merve 2014 年 10 月 4 日
that totally works, thank you.

サインインしてコメントする。

その他の回答 (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 Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by