How can I change the scale of my boxplot

조회 수: 3 (최근 30일)
Tania
Tania 2014년 7월 22일
댓글: Tania 2014년 7월 23일
Hey! I have tried a few times, but somehow I can not change the y-axis scale of my boxplot. At the moment it has 1 2 3 ... x 10^5 .. I would like to display the number like 100000 or 5000000 without this 1 x 10^5. Can anyone help me?Thank you!

채택된 답변

Michael Haderlein
Michael Haderlein 2014년 7월 22일
Dear Tania,
as far as I know, there's no dynamic way to do so. But you can use
set(gca,'yticklabel',num2str(get(gca,'ytick')'))
to set it manually. When you change the range of the axis (by adding further points), you should first reset the yticklabelmode and then reset the labeling:
set(gca,'yticklabelmode','auto')
set(gca,'yticklabel',num2str(get(gca,'ytick')'))
Best regards,
Michael
  댓글 수: 1
Tania
Tania 2014년 7월 23일
Thank you.I have done that, but now my graph on both axis only goes from 0-1. How can I specify it exactly in the way I want it? Y-axis 10.000 – 50.000? Thank you!

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

추가 답변 (1개)

Michael Haderlein
Michael Haderlein 2014년 7월 23일
First plot your data and then set the labeling. It should then conserve the limits.
  댓글 수: 1
Tania
Tania 2014년 7월 23일
Great it worked! thanks so much!

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by