How can I use the ERRORBAR function with a logarithmic axis in MATLAB?
44 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Comentada: Ohad BarSimanTov
el 27 de Jul. de 2016
When I type the following at the MATLAB prompt, I get a an errorbar with a log x axis:
x = 1:100;
y = sin(x);
e = std(y)*ones(size(x));
errorbar(x,y,e)
set(gca,'xscale','log')
However, the errorbars of the first point in the resulting figure extend much farther than the other errorbars. I would like a function that can account for the logrithmic X-axis and make all of the errorbars have a uniform width.
Respuesta aceptada
MathWorks Support Team
el 27 de Jun. de 2009
A function that can account for the logarithmic X-axis and make all of the errorbars have a uniform width is not available in MATLAB.
As a workaround, try using the function 'errorbarlogx' from MATLAB Central. When ERRORBAR is used on a logarithmic scale the horizontal lines also become scaled and the lines become uneven. 'errorbarlogx' makes the horizontal lines uniform again.
Note that MathWorks does not guarantee or warrant the use or content of these submissions. Any questions, issues, or complaints should be directed to the contributing author.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Errorbars en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!