How can I set the Xtick / Ytick labels of my axes with the "Interpreter" as "none" in Matlab 8.4 (R 2014b) Version?

143 ビュー (過去 30 日間)
I used the following code to create a bar plot and then to change the yticklabel names. But I noticed in R2014b version, By default the yticklabels are assigned with "interpreter" as "tex". And also in previous versions the "interpreter" is setr as "none". Now I want to make them to "none" in 2014b Version.
figure(1);
barh([4,1,3,2]);
y_tick_name={'Jan_Mar','Apr_Jun','Jul_Sep','Oct_Dec'};
set(gca,'YTickLabel',y_tick_name);
  2 件のコメント
Rakesh Kumar
Rakesh Kumar 2015 年 1 月 12 日
pls find the difference in plotting for same set of code mentioned above in different versions of Matlab
Noemie Danne
Noemie Danne 2021 年 9 月 29 日
You can also do
y_tick_name={'Jan_{Mar}','Apr_{Jun}','Jul_{Sep}','Oct_{Dec}'};
with _{}
iinstead of
y_tick_name={'Jan_Mar','Apr_Jun','Jul_Sep','Oct_Dec'};

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

採用された回答

Titus Edelhofer
Titus Edelhofer 2015 年 1 月 12 日
Hi,
interesting, haven't observed this yet. I admit, I don't know how to change the "property" (in "", because there is no property "interpreter" for the axis).
As a work around (in case I'm missing something), you might use
y_tick_name={'Jan\_Mar','Apr\_Jun','Jul\_Sep','Oct\_Dec'};
to display the names nicely.
Titus
  1 件のコメント
Rakesh Kumar
Rakesh Kumar 2015 年 1 月 12 日
Hi Titus,
This workaround you suggested is working fine.
But I think it is not the permanent solution, like if the yticklabel text is coming from other source, then we have to add a for loop and change all the text by replacing "_" with "\_".
As time being i will work with your suggestion.
Thanks,
Rakesh.

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

その他の回答 (1 件)

Mike Garrity
Mike Garrity 2015 年 1 月 12 日
Or you can override the default interpreter:
set(gca,'TickLabelInterpreter','none')
  4 件のコメント
Pearl
Pearl 2015 年 8 月 28 日
Didn't even know that they have that now! Thanks so much!!
Rasmus Herlo
Rasmus Herlo 2021 年 11 月 13 日
Exactly what I needed. Perfect!

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

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by