Incorrect display for special characters in the axis label

5 ビュー (過去 30 日間)
Zhongkai
Zhongkai 2013 年 2 月 18 日
I am trying to display the special character Angstrom(char(197)) in the axis label. With char(197) only the display seems all right, but with anything in front of it the display is incorrect. Here is the code:
figure;
ylabel([char(197)],'Interpreter','tex','FontSize',20)
xlabel(strcat('a',[char(197)]),'Interpreter','tex','FontSize',20)
As the y axis label displays Angstrom correctly, the x axis label only displays "a?", which shows incorrect encoding. Please help me with that issue. Thank you.
  3 件のコメント
the cyclist
the cyclist 2013 年 2 月 18 日
Both the x and y labels correctly display the Angstrom character for me, when I use your exact code. I am using the prerelease of R2013a.
Walter Roberson
Walter Roberson 2013 年 2 月 18 日
Which operating system are you using, and which MATLAB version are you using? Also, which renderer are you using for your figure?

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

回答 (1 件)

Mark Whirdy
Mark Whirdy 2013 年 2 月 18 日
using your script I get "aÅ" on x-axis but you get "a?" ??
try the script below (even though its the same thing)
xlabel(['a',char(197)],'Interpreter','tex','FontSize',20)
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 18 日
If it's the same thing, what are you expecting?

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

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by