Azzera filtri
Azzera filtri

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

17 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Jan
Jan il 18 Mag 2013
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.

Più risposte (0)

Categorie

Scopri di più su Graphics Object Identification in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by