필터 지우기
필터 지우기

semilogy plot does not have a continuous line going through zero values

조회 수: 6 (최근 30일)
Hi I have the following data
x = 1:24 y = [0 0 0 0 2 6 11 15 22 25 27 27 25 20 14 9 4 1 0 0 0 0 0 0]'
I want to use the semilogy plot to only have a log plot on the y axis. However, the line going through the data disappears when y=0. Is there a way to avoid this and show the line going through zero.
thank you

채택된 답변

Jan
Jan 2013년 5월 18일
What should appear for the zero? A logarithmic scale has no suitable value for a zero. Try this:
x = 1:24;
y = [0 0 0 0 2 6 11 15 22 25 27 27 25 20 14 9 4 1 0 0 0 0 0 0];
figure;
semilogy(x, y);
figure;
semilogy(x, max(eps, y));
In the second figure, the EPS values appear as 2e-16 (of course). To get a real zero, the scale must be infinitely large.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by