create envelope from multiple qqplot curves

3 次查看(过去 30 天)
Hi,
I have a number of qqplot curves from which I would like to create an envelope region that covers the area occupied by all of the curves.
I have tried using convhull but unsuccessfully,
say for example I have: x1=rand(1,10); y1=rand(1,10); qqplot(x1); hold on; qqplot(y1);
any idea on how to proceed to fill the region between the two curves?
Also: is there a way to store the Xdata and Ydata from the qqplot?
Thanks in advance

回答(1 个)

José-Luis
José-Luis 2012-9-17
编辑:José-Luis 2012-9-17
This will work if both datasets ( x1 and y1) have the same length:
data = rand(10,2);
x1 = data(:,1);
y1 = data(:,2);
h1 = qqplot(x1);
hold on;
h2 = qqplot(y1);
xData_x1 = get(h1(1),'Xdata');
yData_x1 = get(h1(1),'YData');
xData_y1 = get(h2(1),'Xdata');
yData_y1 = get(h2(1),'YData');
tempVal = max([yData_x1;yData_y1]);
yData_y1 = min([yData_x1;yData_y1]);
yData_x1 = tempVal;
patch([xData_x1 , fliplr(xData_x1)],[yData_x1 , fliplr(yData_y1)],'blue','FaceAlpha',0.5)

类别

Help CenterFile Exchange 中查找有关 Signal Reception and Recovery 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by