Trying to plot two bar graphs that use the same x and y axis tick labels and values respectively for each axis. The bar graphs are being plotted correctly except the axis labels for the x and y axis (YLim) or YTick are being ignored and rather replaced by generic default values it appears. Any ideas? Here is a message I get when I execute the .m file.
An axes's "XTickLabel" property does not have a fixed set of property values.

답변 (1개)

Walter Roberson
Walter Roberson 2011년 3월 18일

0 개 추천

Do you happen to be using datetick() ? If so, then use the 'keeptick' option to it.
Are you using plotyy? If so are you applying the settings to both axes ?

댓글 수: 2

Randall
Randall 2011년 3월 18일
편집: per isakson 2017년 8월 19일
I am not using datetick. These are the inputs that Matlab is ignoring -
get(gca,'XTickLabel');
figure(3)
set(gca,'XTickLabel',{'R1N'; 'R1S'; 'R2'; 'R3'; 'R4'});
set(gca,'YLim',[60 120]);
set(gca,'YTick',[60 70 80 90 100 110 120 130 140]);
Walter Roberson
Walter Roberson 2011년 3월 18일
You fetch the XTickLabel from the first axis, then you create a new figure (which would have a new axis) and set to labels to something different. That isn't going to affect the first axis.

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

카테고리

태그

질문:

2011년 3월 18일

편집:

2017년 8월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by