How to add standard deviation to the boxplot?
조회 수: 59 (최근 30일)
이전 댓글 표시
Having boxplot, I added mean value by hold on command on the box plot. I wanted to know whether it is common to add standard deviation to the boxplot? Becase boxplot is based on median and quartile I am not sure if it is bizarre to add std to the plot or not. and how to do it?
댓글 수: 1
Wiqas Ahmad
2021년 4월 20일
How did you get this plot? I'm trying boxplot to plot the error on my data but unable to do it. Can you show me your code? or just type the boxplotting code?
답변 (1개)
Adam Danz
2020년 1월 2일
편집: Adam Danz
2020년 1월 2일
I wouldn't call it bizarre. Often times it's useful to compare means/medians and IQR/std. It may reveal how skewed your data are. Instead of plotting the means using plot(), you can plot the means and standard deviation using errorbar(x,y,neg,pos,'s') where x are the boxplot centers, y are the means, neg/pos are the -/+ std, and 's' will show a square marker for the mean values.
Or maybe you want to show 2 standard deviations using
errorbar(x, y, -2*std(...), 2*(std...), 's')
댓글 수: 5
Adam Danz
2020년 1월 6일
It's the same story as this : https://www.mathworks.com/matlabcentral/answers/488524-different-error-bar-color-than-the-plot#answer_399161
참고 항목
카테고리
Help Center 및 File Exchange에서 Errorbars에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!