Errorbars on bar-graph

后端 未结 2 1274
终归单人心
终归单人心 2021-01-06 19:00

I\'m trying to get: a nice bar graph of groups. I\'d like error bars on each bar like this (or similar at your discretion):

2条回答
  •  渐次进展
    2021-01-06 19:19

    It's really not that crazy!

    You can just use errorbar with the data that you have readily available.

    This code computes the correct locations, by adding 1 for every group and 1/7 for each bar within a group.

    for i = 1:5
        j = 1:6; 
        x = -0.5 + i + 1/7 * j; 
        errorbar(x, ff(j,i), ee(j,i), '.'); 
    end
    

    Results in:

    enter image description here

    (Leaving out the labels, but otherwise this seems pretty similar to what you were looking for)

提交回复
热议问题