Error bars with categorical data type
17 views (last 30 days)
Show older comments
Commented: L'O.G. on 28 Nov 2022
I am trying to plot error bars in y for data that are categorial type in x. I get an error message saying
Error argument 'err' must be empty when the data are categorical.
How can I plot the error bars in y? I feel like the type in x shouldn't matter.
I am attempting this by
Steven Lord on 28 Nov 2022
Let's say that your categorical x data contains values apple, banana, and cherry. When the error bars are plotted with errorbar, the caps of the bars do have some width. So how wide should the cap of the error bar for banana be? Halfway between apple and banana to halfway between banana and cherry? How should that be specified?
I suspect that cap width issue is the reason why the err input argument is not supported for categorical data.
Find more on Bar 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!