%分组group箱线图和折线图的合并版本
%% clear data
%% edge color
edgecolor1=[0.8,0.8,0.8]; % white color:[1,1,1],如果设置成了白色就没有箱子线图边框
edgecolor2=[0.8,0.8,0.8]; % white color
edgecolor3=[0.8,0.8,0.8]; % white color
position_1 = [0.8:1:4.8]; % define position for first group boxplot
position_2 = [1.0:1:5.0]; % define position for second group boxplot
position_3 = [1.2:1:5.2]; % define position for second group boxplot
%分别农村箱线图和对应平均值和中位数的折线图,注意boxplot当有横坐标还想设置位置时用position
figure(2)
box_1 = boxplot(CALCULATE_data_nc,t_nc,'positions',position_1,'colors', ...
edgecolor1,'width',0.1,'notch','on','symbol','');
hold on;
p1=plot(position_1,mean_nc,'o',position_1,med_nc,'-')
p1(2).LineWidth = 1;%set median linewidth to 1
p1(2).Color = [.6,.1,.3];p1(1).Color = [.6,.1