Errorbar overlapping with the left and right border of a plot

1 visualización (últimos 30 días)
a = [1,2,3,4;5,6,7,8]
errorbar(mean(a),std(a))
The two lines of code above generate an line of mean value with errorbars. However, the leftmost and the rightmost errorbar overlapped with the left and right border of the plot. Is there anyway to avoid it?

Respuesta aceptada

Star Strider
Star Strider el 27 de Oct. de 2021
Add an xlim (or axis) call —
a = [1,2,3,4;5,6,7,8]
a = 2×4
1 2 3 4 5 6 7 8
figure
errorbar(mean(a),std(a))
xlim(xlim+[-1 1]*0.2) % <— ADD THIS
Make appropriate changes to get the desired result.
.

Más respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by