in the new version of Matlab2010b the lines are not there.
Any clue how to resolve this issue?
Thanks.
Yes, the boxplot function was substantially re-written since then. One thing
that was added was a collection of tags to the graphics elements so that you
can post-process the plot without modifying the toolbox function. So, while
the following might seem involved, I recommend it as a safer way to get what
you want.
-- Tom
x = gallery('normaldata',[100 5],0);
p = prctile(x,[5 95])
boxplot(x);
% Replace upper end y value of whisker
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
Thanks Tom.
It worked and is of great help :)
Aditya