2017-02-20 79 views

回答

2

你可以做以下(使用boxplot後):

max_bounds = [2 3 2]; % set the maximum bound by category 
min_bounds = [-1 -2 -1]; % set the minimum bound by category 
x = repmat(1:numel(max_bounds),[2 1]); % make x values for all categories 
x = bsxfun(@plus,x,[-0.1; 0.1]); % make the lines in length of 0.2 
hold on 
% plot it all: 
plot(x,repmat(min_bounds,[2 1]),'r',x,repmat(max_bounds,[2 1]),'r') 

boxplot

相關問題