How do errorbars change in logplot?

8 visualizaciones (últimos 30 días)
Wout Laeremans
Wout Laeremans el 9 de Abr. de 2023
Respondida: Star Strider el 9 de Abr. de 2023
Hi all,
I have a collection of data points at every timestep, say at timestep , I have a collection of points . For I have again and so on. Then I plot the average at every timestep together with the errorbars, giving the 95% confidence interval. My question is now, if I then do:
set(gca, 'YScale', 'log')
What happens to the errorbars? For example, does the average of the errorbar in logspace become the log of the old errorbar or does it become the average of the log of the data points? How exactly thus the rescaling happen?
Thank you in advance for your reply!

Respuestas (1)

Star Strider
Star Strider el 9 de Abr. de 2023
The error bars scale with appropriate axis scales, and negative error bars or error bars equal; to zero do not plot at all on a logarithmic axis —
x = 1:10;
y = rand(size(x));
err = randn(size(x))*0.1;
figure
errorbar(x, y, err)
grid
figure
errorbar(x, y, err)
grid
set(gca, 'YScale','log')
Warning: Negative data ignored
(This also neatly illustrates the problem of doing a regression on logarithmically-scaled variables, because the actual errors behave the same way. They are multiplicative, not additive, violating the assumptions of least-squares parameter estimation.)
.

Categorías

Más información sobre Errorbars en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by