Effacer les filtres
Effacer les filtres

Strange behavior with subplot command: plots only the last plot

3 vues (au cours des 30 derniers jours)
amg
amg le 8 Avr 2015
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.)

Réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by