Visualizing min, max and mean

131 ビュー (過去 30 日間)
Bas
Bas 2016 年 9 月 27 日
回答済み: Sathyanarayan Rao 2017 年 11 月 10 日
Hello,
I'm looking for a way to plot my data like in this figure. I'm having a matrix A containing information on a larger dataset with values for A B C & D.
  • A(1,:)= {'A' 'B' 'C' 'D'}
  • A(2,:)= [ 1 6 10 13] % minimum values
  • A(3,:)= [ 7 9 16 21] % mean values
  • A(4,:)= [ 9 10 22 29] % maximum values
I would like to plot these data in some sort of boxplot, only showing the min max and mean values like in the example in the figure. So that it looks like some sort of boxplot without the actual boxes.
Can anyone help me with this?
Thanks in advance.

回答 (2 件)

José-Luis
José-Luis 2016 年 9 月 27 日
編集済み: José-Luis 2016 年 9 月 27 日

Sathyanarayan Rao
Sathyanarayan Rao 2017 年 11 月 10 日
x = [1 2 3 4 5];
ymin = [0.01 0.02 0.03 0.04 0.05]; % lower error bar position
ymax = [0.02 0.03 0.04 0.05 0.06]; % upper error bar position
% draw error bar from minimum value to maximum value
errorbar(x,(ymin+ymax)/2,(ymax-ymin)/2)

Community Treasure Hunt

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

Start Hunting!

Translated by