How to remove regression line from qqplot?
7 次查看(过去 30 天)
显示 更早的评论
Hello all, For some reason, i don't want the auto fitted line (red in the picture)in my Q-Q plot. Is there any function to turned it off? here is my code for the picture attached. Also, any thoughts on how to add the Confidence Intervals?
qqplot(obs_high,M1_high); hold on
plot([0 400], [0 400])
xlabel('Observed streamflow (m^3/sec)')
ylabel('simulated streamflow (m^3/sec)')
title('Model-1');
0 个评论
采纳的回答
Star Strider
2017-7-26
Return a handle from your qqplot call, then find the line you want to remove, (experiment) and set its color to 'none'.
Example —
hqq = qqplot(obs_high,M1_high);
hqq(2).Color = 'none';
Note — I don’t know if the Line object referred to here as ‘hgg(2)’ is the one you want.
2 个评论
Star Strider
2017-7-26
Thank you. My pleasure.
The confidence intervals aren’t an option in qqplot itself, and I’m not certain how the quantiles or the regression line are calculated.
One option is to use fitlm to calculate the regression and the confidence intervals for the plot.
Example —
load gas
figure(1)
hqq = qqplot(price1);
XD = hqq(1).XData;
YD = hqq(1).YData;
mdl = fitlm(XD(:),YD(:));
[ypred,yci] = predict(mdl,XD(:));
figure(2)
plot(XD, YD, '+b')
hold on
plot(XD(:),ypred,'-r', XD(:),yci,'--r')
hold off
However, the regression line is different from that calculated by qqplot, at least with these data. Since I rarely use qqplot and am not certain how it works internally, you will probably need to ask MathWorks how best to calculate the regression line and confidence intervals.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!