Strange behavior with subplot command: plots only the last plot
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm trying to plot subplots, but the command only produces a single plot (the very last one) in a single figure window. I've run code for subplots that was previously working fine only to have the same problem.
To troubleshoot, I also ran the code on Matlab's documentation page for subplot (below), and again it produces just a single plot, the last one, taking up the entire figure. What's going on and is there a way to fix it?
Code from Matlab documentation page:
x = linspace(0,10);
y1 = sin(x);
y2 = sin(5*x);
figure
subplot(2,1,1);
plot(x,y1)
subplot(2,1,2);
plot(x,y2)
(I use Matlab 2014a on a Mac.)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148882/image.png)
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Subplots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!