create envelope from multiple qqplot curves

3 Ansichten (letzte 30 Tage)
Ignazio G
Ignazio G am 17 Sep. 2012
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

Antworten (1)

José-Luis
José-Luis am 17 Sep. 2012
Bearbeitet: José-Luis am 17 Sep. 2012
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)

Kategorien

Mehr zu Signal Reception and Recovery finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by