dpb
Posts:
8,515
Registered:
6/7/07


Re: Looped inset plot
Posted:
Jan 18, 2013 5:23 PM


On 1/18/2013 2:55 PM, dpb wrote: ...
> Play around w/ the following revamping of your example and see the > changes I've made...
Well, that obviously would be easier if I hadn't forgotten to ^V... :)
close 1 x = chi2pdf(sort(abs(randn(1,100))),2); y = x.*abs(randn(size(x)));
figure h1 = axes; h2 = axes('pos',[.2 .5 .1 .4]); set(h2,'fontsize',8) while true axes(h1) plot(x,y,'*') lsline title(['R^2 = ',num2str(corr(x',y')^2,4)]) axes(h2) boxplot(y)
pause(1) m = mean(y); outlier = quantile(y,.75) + 1.5*iqr(y); if any(y>=outlier) [~,ix]=max(y); x(ix)=[]; y(ix)=[]; else break end end
...
Your earlier test code (very slightly modified as well) pasted below...
z = find(y >= outlier); if ~isempty(z) [~ ind] = sort(y,'descend'); y(ind(1)) = []; x(ind(1)) = []; else break end


