Evg*_*eev 13 matlab matlab-figure
如果f
是数字句柄,我想像plot3(..)
我一样使用它plot(..)
,但这不起作用:
>> plot3(f, t, real(Y), imag(Y))
Error using plot3
Vectors must be the same lengths.
Run Code Online (Sandbox Code Playgroud)
然后我发现这样做的方法是:
首先使相关数字变为现实.
然后使用该plot3(..)
功能.
我可以找到当前数字正在使用的内容gcf
,但是如何使数字变为当前数字(通过其句柄)?
Rod*_*uis 30
这种方法有我个人的偏好:
set(0, 'currentfigure', f); %# for figures
set(f, 'currentaxes', axs); %# for axes with handle axs on figure f
Run Code Online (Sandbox Code Playgroud)
因为这些命令是他们自己的文档.我发现
figure(f)
Run Code Online (Sandbox Code Playgroud)
在第一次阅读时会感到困惑 - 你是否创造了一个新的形象?或仅仅使一个现有的活跃? - >需要更多地阅读上下文.
它实际上就像f
将figure(..)
命令反馈到命令一样简单:
figure(f) %Makes the figure current.
Run Code Online (Sandbox Code Playgroud)
另外,如果我做了这样的事情:
f = figure('IntegerHandle','off'); % With unique, non-reusable handle.
top = subplot(2, 1, 1);
bot = subplot(2, 1, 2);
Run Code Online (Sandbox Code Playgroud)
然后我可以通过发出如下命令来制作轴 top
或bottom
当前:
subplot(top);
Run Code Online (Sandbox Code Playgroud)
这也有效:
axes(top);
Run Code Online (Sandbox Code Playgroud)
但是两种类型的手柄不能混合:axes(..)
并且subplot(..)
在轴上处理,而figure(..)
在图形手柄上工作.