title: Matlab Boxplot: Use a specific percentile as the upper whisker OR remove redundant outliers after manual upper whisker edit
body: <p>For boxplots in MATLAB, I'd like to ask if a specific percentile can be used as the upper whisker. I'd like to use the 95th percentile as the upper whisker and 5th percentile as the lower whisker.</p>
  
  <p>MATLAB's default behaviour is to have the whisker length = 1.5 * IQR (75th percentile - 25th percentile) and this whisker length can be changed to another multiple of IQR, but not to a specific percentile. Please can the method to change this be explained.</p>
  
  <p>For example, for the following 100 pieces of data:</p>
  
  <p>50 (repeated 80 times),
  76 (repeated 10 times),
  91, 92, 93, 94, 95, 96, 97, 98, 99, 100</p>
  
  <p>or in MATLAB:</p>
  
  <pre><code>A([1:80],1) = 50; A([81:90],1) = 76; A([91:100],1) = [91:100]; boxplot(A)
  </code></pre>
  
  <p>Is there a way to specify 95 or even 76 to be within the whiskers? or the value of the upper whisker?</p>
  
  <p>I have adjusted the upper and lower whiskers (although lower whisker is not needed in this example) using the following code; however this code doesn't remove outliers within the whisker making the result look unclear.</p>
  
  <pre><code>p([1:2],1) =prctile(A,[5,95])
  h = flipud(findobj(gca,'Tag','Upper Whisker'));
  for j=1:length(h);
  ydata = get(h(j),'YData');
  ydata(2) = p(2,j);
  set(h(j),'YData',ydata);
  end
  % Replace all y values of adjacent value
  h = flipud(findobj(gca,'Tag','Upper Adjacent Value'));
  for j=1:length(h);
  ydata = get(h(j),'YData');
  ydata(:) = p(2,j);
  set(h(j),'YData',ydata);
  end
  % Replace lower end y value of whisker
  h = flipud(findobj(gca,'Tag','Lower Whisker'));
  for j=1:length(h);
  ydata = get(h(j),'YData');
  ydata(1) = p(1,j);
  set(h(j),'YData',ydata);
  end
  % Replace all y values of adjacent value
  h = flipud(findobj(gca,'Tag','Lower Adjacent Value'));
  for j=1:length(h);
  ydata = get(h(j),'YData');
  ydata(:) = p(1,j);
  set(h(j),'YData',ydata);
  end
  </code></pre>
  
  <p>Any help will be highly appreciated!</p>
  
  <p>Thank you!</p>