How Can I make a plot linear regression in a subplot ?
조회 수: 11 (최근 30일)
이전 댓글 표시
I'm using the command "plotregression(targets,outputs)" to plot a linear regression.I have something like this:


But I want to put this figures in a subplot.How can I make this ?
because I've already tried to make:
subplot(2,1,1)
plotregression(x,y)
...
But the "plotregression" appears in different figures.Can anyone help me ?
Thanks
댓글 수: 0
답변 (1개)
Image Analyst
2013년 9월 29일
You're probably calling "figure" in one or more places. Don't do that. Figures will be created if needed. If you called it after the first call to subplot, then the second subplot will show up on the second figure instead of the first. So the order is:
subplot(2,1,1);
% Plot the first graph.
subplot(2,1,2);
% Then plot the second graph.
댓글 수: 2
Image Analyst
2015년 2월 16일
Corona's "Answer" moved here:
with eliminating 'figure' doesn't work yet! with plotregression(target1,output1,'name1',target2,output2,'name2'), it does work. but i don't wan't to use it. i must use by subplot. how one can help me?
Image Analyst
2015년 2월 16일
Then you'll have to dig into plotregression() and see what it does. Add subplot() to it's code. I don't have that so I can't do it. But I imagine you'd take additional inputs that are the number of rows, number of columns, and the plot number. Then call subplot(). You have its source code, don't you? Can you do what I said? If not, post the function with the paper clip icon.
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!