Strange behavior with subplot command: plots only the last plot
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!