How Can I make a plot linear regression in a subplot ?

3 ビュー (過去 30 日間)
Luiz Felippe
Luiz Felippe 2013 年 9 月 29 日
コメント済み: Image Analyst 2015 年 2 月 16 日
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

回答 (1 件)

Image Analyst
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
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
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 ExchangeLine Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by