How to plot a vertical line in a semilog diagram?

조회 수: 9 (최근 30일)
nilsotto
nilsotto 2016년 2월 20일
편집: Hazem Elgbara 2018년 5월 15일
Hi, Actually, I want to draw a red rectangle by letting the horizontal red line stop at 1000 counts, and then a vertical line down to the x-axis. Look at the supplemented file 'kalle.png'. Is this possible using semilogx or other similar function?
  댓글 수: 1
dpb
dpb 2016년 2월 20일
편집: dpb 2016년 2월 20일
No file attached...but--
What's the problem in just drawing lines where wanted? The input to the semilog$ or loglog routines are in the underlying units so there's no issue of what values to use. You can always query the axis limits to determine what they are in the plot if that's the uncertainty. Use hold on before adding more to the plot, of course, to retain the existing plot.

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

답변 (1개)

Hazem Elgbara
Hazem Elgbara 2018년 5월 15일
편집: Hazem Elgbara 2018년 5월 15일
I had the same problem and found my solution here: semilogy([34,34],[0,22222]) does not show vertical line
This is my code:
semilogy(data(:,2))
hold on
semilogy(data(:,3))
cut = 50; ycut = [1e-10 max(max(data(:,2:3)))];
semilogy([cut cut],ycut)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by