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

1 次查看(过去 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

回答(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 CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by