www.gusucode.com > stats 源码程序 matlab案例代码 > stats/AdjustNormalProbabilityPlotLinePropertiesExample.m
%% Adjust Normal Probability Plot Line Properties %% % Create a 50-by-2 matrix containing 50 random numbers from each of two % different distributions: A standard normal distribution in column 1, and % a set of Pearson random numbers with |mu| equal to 0, |sigma| equal to 1, % skewness equal to 0.5, and kurtosis equal to 3 (a "right-skewed" % distribution) in column 2. rng default % For reproducibility x = [normrnd(0,1,[50,1]) pearsrnd(0,1,0.5,3,[50,1])]; %% % Create a normal probability plot for both samples on the same figure. % Return the plot line graphic handles. figure h = normplot(x) legend({'Normal','Right-Skewed'},'Location','southeast') %% % The handles h(1) and h(2) correspond to the data points for the normal % and skewed distributions, respectively. The handles h(3) and h(4) % correspond to the second and third quartile line fit to the sample data. % The handles h(5) and h(6) correspond to the extrapolated line that % extends to the minimum and maximum of each set of sample data. %% % To illustrate, increase the line width of the second and third quartile % line for the normally distributed data sample (represented by h(3)) to 2. h(3).LineWidth = 2; h(4).LineWidth = 2;