Start plot errorbar() at 0 ?
Mostra commenti meno recenti
Hello,
In my matlab script, i use errorbar() to plot my data, but i wish it could start from 0 (for the y-axis).
Do you have an idea ?
Thanks !
Here is my sample :
>> x
moyenne(2:2,1:end)
ste(1:1,1:end)
x =
1 2
ans =
64.7573 36.0701
ans =
4.0268 4.6105
>> errorbar(x,moyenne(2:2,1:end),ste(1:1,1:end));
Risposta accettata
Più risposte (1)
Remi Chaussenot
il 27 Apr 2015
2 Commenti
Michael Haderlein
il 27 Apr 2015
First, please note that the '' in your if statement are making things wrong. You actually compare the lower limit with the string '0'. This means, the value of the ascii sign '0' will be used which is 48. So you set oldy(1) to zero only if it was at least 49 before. That's not what you wanted, I guess.
However, your code works because the if structure makes nothing at all. The reason is that you don't even use the value of oldy(1) in your set statement. So you can simply delete the entire if statement. What you then end up with is basically the same as Jos' answer. If you use ylim() or set(handle,'ylim',..) is up to you.
Remi Chaussenot
il 28 Apr 2015
Modificato: Remi Chaussenot
il 28 Apr 2015
Categorie
Scopri di più su Errorbars in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!