Subplot - Plots are not displayed
27 ビュー (過去 30 日間)
古いコメントを表示
Hi
I use the following easy script do plot some functions in subplots:
x = [1 3 4 5];
y = [2.3 4.1 5.2 -1];
z = [1 1 1 1];
a = [12 13 44 1];
subplot(2,2,1); plot(x)
subplot(2,2,2); plot(y)
subplot(2,2,3); plot(z)
subplot(2,2,4); plot(a)
But when I run the programm, although no error message occurs, also no plots are displayed. Why so? Thanks
2 件のコメント
回答 (2 件)
the cyclist
2013 年 1 月 27 日
The only thing I can think of is that your current figure window is either off your screen somewhere, or has the 'Visible' property set to 'off', so that it is not displaying.
What do you get for the 'Visible' property if you type
get(gcf)
Also, do you see the plots if you add a figure command in front of your plotting commands?
figure
x = [1 3 4 5];
y = [2.3 4.1 5.2 -1];
z = [1 1 1 1];
a = [12 13 44 1];
subplot(2,2,1); plot(x)
subplot(2,2,2); plot(y)
subplot(2,2,3); plot(z)
subplot(2,2,4); plot(a)
Failing that, I would restart MATLAB, and/or restart your computer. Not sure what to try other than that.
2 件のコメント
the cyclist
2013 年 1 月 27 日
I am not familiar with that error, but it suggests that MATLAB is somehow stuck trying to open a figure window.
You could try
>> close force all hidden
to try to shut all figure windows (and hopefully the pending one), and then try to run your code again.
Does this happen with a brand-new instance of MATLAB, in which you have not run any other commands? If so, that is extraordinarily weird to me, and I have no further suggestions other than to contact MathWorks support.
ks905383
2015 年 8 月 12 日
So I had this problem as well, and after messing around for a long time, I found a fix - there seemed to have been an issue with the image renderer it was trying to use. Setting
set(gcf,'Renderer','zbuffer')
Fixed the problem for me (I haven't tried it for different renderers, and I still don't know why this might've happened, without an error message)
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!