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

1 visualización (últimos 30 días)
Luiz Felippe
Luiz Felippe el 29 de Sept. de 2013
Comentada: Image Analyst el 16 de Feb. de 2015
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

Respuestas (1)

Image Analyst
Image Analyst el 29 de Sept. de 2013
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 comentarios
Image Analyst
Image Analyst el 16 de Feb. de 2015
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 el 16 de Feb. de 2015
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by