Clear Filters
Clear Filters

Adding error bars to a plot

31 views (last 30 days)
Samuele Bolotta
Samuele Bolotta on 20 Jul 2021
Answered: Star Strider on 20 Jul 2021
I created six plots. Each of this plot is created from a 4x3 matrix. The 12 values in this matrix are averages. Is there a way to add another 4x3 matrix for each plot, which contains the 12 standard deviations so that I can add error bars?

Answers (1)

Star Strider
Star Strider on 20 Jul 2021
I do not understand what you want to do, although that is definitely possible.
Examples —
y = rand(4,3)*10;
err = rand(4,3)/5;
errorbar(y, err)
xlim([0 5])
errorbar(y.', err.')
xlim([0 4])


Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!