create envelope from multiple qqplot curves
Afficher commentaires plus anciens
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
Réponses (1)
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)
Catégories
En savoir plus sur Signal Reception and Recovery dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!