Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Looped inset plot
Replies: 9   Last Post: Jan 18, 2013 5:23 PM

 Messages: [ Previous | Next ]
 dpb Posts: 9,850 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

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

--

Date Subject Author
1/16/13 dpb
1/16/13 dpb
1/16/13 dpb
1/18/13 dpb
1/18/13 dpb
1/18/13 dpb