필터 지우기
필터 지우기

SEMILOGY not printing proper y axis labels

조회 수: 4 (최근 30일)
Sam Butler
Sam Butler 2013년 10월 28일
답변: Wayne King 2013년 10월 28일
I am creating 4 total plots, 2 per figure, using the same data; the first plot is a regular plot (using subplot and plot commands in MatLab R2013b); the second plot is a semilogy plot of the same data (using subplot and semilogy commands).
When I look at the results of the regular figure, I have a plot in real space that ranges from about 0 to 24 on the y axis, for both the top and bottom plots.
When I look at the results of the semilogy figure, I have a plot in real space that appears to be the right shape, but the y axis labels are wrong on both plots; there is only one label, midway up the y axis, with a value of 1 (ie, 10^0) on both plots. There are two problems with this: first, with only one label, it is difficult to determine the actual spacing; second, the plot should have a marking for at least 10^1 (ie, 10) as well, since I know the function has a value of at least 10.
I am using set(gca, 'YScale', 'log') already, as was indicated by another person's question, but that is not working; my results are the same regardless of whether I use that command.
How do I get the axis labels to display properly?

답변 (1개)

Wayne King
Wayne King 2013년 10월 28일
Without the data, it's difficult to say exactly what is going on, but can you just set the yticks?
y = 0.1:0.5:24;
semilogy(y)
set(gca,'ytick',[10^-1 10^0 10^1])

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by