create envelope from multiple qqplot curves

조회 수: 2 (최근 30일)
Ignazio G
Ignazio G 2012년 9월 17일
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