h = qqplot(X,Y,pvec)
qqplot(X,PD) makes an empirical quantile-quantile plot of the quantiles of the data in the vector X versus the quantiles of the distribution specified by PD, a ProbDist object of the ProbDistUnivParam class or ProbDistUnivKernel class.
For matrix X and Y, qqplot displays a separate line for each pair of columns. The plotted quantiles are the quantiles of the smaller data set.
The plot has the sample data displayed with the plot symbol '+'. Superimposed on the plot is a line joining the first and third quartiles of each distribution (this is a robust linear fit of the order statistics of the two samples). This line is extrapolated out to the ends of the sample to help evaluate the linearity of the data.
Use qqplot(X,Y,pvec) to specify the quantiles in the vector pvec.
This example shows how to create a quantile-quantile plot using two sets of sample data.
Generate random numbers from two Poisson distributions. The vector x contains 50 random numbers from a Poisson distribution with lambda = 10. The vector y contains 100 random numbers from a Poisson distribution with lambda = 5.
rng default; % For reproducibility x = poissrnd(10,50,1); y = poissrnd(5,100,1);
Create a quantile-quantile plot using the two sets of sample data.
The solid line in the plot joins the first and third quartiles. The dashed line extrapolates the solid line.