Odd Subplot Behavior - Script interpreter bug?
조회 수: 1 (최근 30일)
이전 댓글 표시
I've got a script that produces some plots. It's nothing fancy. I haven't included all the variable definitions in the code snippet below because they're not important. But you can see, I'm just using subplot and plot to make a bunch of plots.
If I just consider one loop (for jj = 1:1) I get the following set of plots.
If I allow jj to advance to 2 (for jj=1:2) I get this next set of images. Notice that the bottom plot in the first column is changed (and the axes go all whacky) but the second loop didn't change any of the first column plots.
Finally, if I let jj advance to 3 (for jj=1:3) The bottom plot in the middle column also gets ruined.
Now, here's the really weird part. If I change jj by hand and then copy/paste the same commands from the script editor into the interpreter I don't see any odd behavior at all. New columns are added and previous columns remain unchanged. I'm attaching the 'fig' file for the last plot as well as a snippet of the code I'm using.
Thanks in advance for anyone that can give me a workaround or (better yet) a solution!
I saw the same behavior in 2017b and 2018a. I'm using Windows 10 64-bit on an AMD Threadripper cpu.
for jj = 1:1
% variable_definitions_here
subplot(4,3,jj)
plot(xinside,G,'b-',xoutside,G,'k:')
subplot(4,3,jj+3)
plot(xpatch,ypatch);
subplot(4,3,jj+6)
plot(x,y,'-*');
end
댓글 수: 3
Jason Whitfield
2018년 6월 28일
I tried to reproduce this, but was unsuccessful. However, when I open your figure and run this code, it outputs [90, 45]. So, something is changing the views on your subplots.
sp = subplot(4, 3, 7);
disp(sp.View);
Could you post your full code? It's possible that something is happening in the variable definitions.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!