Hello Everybody,
How can I change X axis in boxplot figure? Unfortunately, my code doesn't work in "set(gca,'Xtick',[950:5:1020])".
See my code below:
%
figure;
global hb;
edgep = [952.5:5:1025];
hb=boxplot(p_w1(2:12,:),edgep,'whisker',100,'Widths',0.2);
set(hb(:,:),'linewidth',1,'linestyle','-');
set(gca,'Xtick',[950:5:1020]);

2 件のコメント

Adam
Adam 2015 年 5 月 15 日
What do you mean by "doesn't work"? Does it give an error or just not update the ticks as you expect?
I don't have your p_w1 variable so can't run the code to check quickly.
Minimax
Minimax 2015 年 5 月 15 日
編集済み: Minimax 2015 年 5 月 15 日
I mean't that the X axis didn't change as i expected.
Enclosed you'll find data for p_w1.
Thank you for your help!

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

 採用された回答

the cyclist
the cyclist 2015 年 5 月 15 日

1 投票

The reason is that the range of the x-axis is actually 1:15, and are only labeled with the values you see.
Try this instead:
set(gca,'Xtick',0.5:15.5);
set(gca,'XtickLabel',[950:5:1025]);

1 件のコメント

Minimax
Minimax 2015 年 5 月 15 日
That's great!!!
Thank you very much for your help!!!!

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

その他の回答 (0 件)

製品

質問済み:

2015 年 5 月 15 日

コメント済み:

2015 年 5 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by