plot 2 different y-values for the same x-value in box plot
이전 댓글 표시
I have two sets of data for the same time series. I want to keep the two box plots in the same figure. (not subplot) .my data is as follows:
X = 2000 2010 2020 2030
Y1 = A = 78 85 23 36
Y2 = B = 25 56 49 89

채택된 답변
추가 답변 (1개)
You are looking for the "bar" function. If you also need the error bars, check out this answer from a previously asked question.
X = [2000 2010 2020 2030] ;;
A = [78 85 23 36];
B = [25 56 49 89];
Y = [A' B'];
bar(X,Y)
댓글 수: 2
RAJAT GANGADHARAN
2020년 3월 6일
Aquatris
2020년 3월 6일
You just need to modify the example code I shown with your data. I think you want someoneelse to do your work, in which case this is not the platform for that.
카테고리
도움말 센터 및 File Exchange에서 Box Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

