例如:
Hsp=subplot(1,2,1);
image(rand(5,5));
Hc=colorbar;
subplot(1,2,2);
image(rand(5,6));
colorbar;
我的问题是,如何获得<代码>Hc,只给出<代码>Hsp。
众所周知,彩票的类型为axes
。 因此,我试图搜查该分区的所有子女。
Hs=findall(Hsp, type , axes );
但<代码>没有价值。 Hs, 对应 Hc
。
例如:
Hsp=subplot(1,2,1);
image(rand(5,5));
Hc=colorbar;
subplot(1,2,2);
image(rand(5,6));
colorbar;
我的问题是,如何获得<代码>Hc,只给出<代码>Hsp。
众所周知,彩票的类型为axes
。 因此,我试图搜查该分区的所有子女。
Hs=findall(Hsp, type , axes );
但<代码>没有价值。 Hs, 对应 Hc
。
你的彩票是数字中的儿童,不是你们的分野轴(col本身就是轴)。 提 出
hc = get(hf, children )
to get a list of all children of the figure, where hf
is the figure handle. I m not sure how you would which element of hc
is equal to your Hc
, i.e. which is the first
colorbar.
http://www.ohchr.org。
www.un.org/Depts/DGACM/index_spanish.htm 如果你需要以后处理物体,最好将其分配到生成时的变量中,并在全程使用这一变量。
然而,如果你不想这样做(尽管我强烈建议你这样做),我可以认为你可以做两件事。 他们不是特别大的,而且无疑是更多的工作,只是把你的物体分配给一个变量。
如果你知道这些轴心的设立次序,那么你就坐在uck子上:如果是孩子,名单上的第一个孩子是last<>em>的,而最后一位孩子是first<>>。 例如,
hf = figure;
ha1 = subplot(1,2,1);
image(rand(5,5));
hc1 = colorbar;
ha2 = subplot(1,2,2);
image(rand(5,5));
hc2 = colorbar;
hcs = get(hf, children )
hcs =
206.0016
204.0011
176.0016
174.0011
[hc2, ha2, hc1, ha1]
ans =
206.0016
204.0011
176.0016
174.0011
Since you want the first colorbar, which was the second child created, you can then use
hc(end-2)
或者,在创造你今后想要提到的彩色时,将它设定为tag/code> 财产。 在上述例子中,取而代之
hc1 = colorbar;
iii
hc1 = colorbar( tag , myID );
You can then get the handle to this object later iii
findobj(hf, type , axes , tag , myID )
采用以下文字可以找到所有属于轴心的儿童的彩色屏障。 这里的Ha1
是指有图像的轴心(例如分机)的操作,Hc1s
为轴心的同 color。
function Hc1s = find_peer_colorbars_of_an_axes(Ha1)
Hf = get(Ha1, parent );
Haxs = findobj(Hf, type , axes );
IsC=false(1,length(Haxs));
Hc1s=[];
for i=1:length(Haxs)
if isa(handle(Haxs(i)), scribe.colorbar );
H=handle(Haxs(i));
if isequal(double(H.axes),Ha1)
Hc1s=[Hc1s,Haxs(i)];
end
end
end
I have a dll that contains legacy C code, I call this dll via JNI, but sometimes the C code crashes and causes the JVM to terminate. Is it there a way to avoid JVM crash? Can I handle the JNI fault ...
Recently, I read a white paper by an individual who refers to a pointer to a struct as a handle. The author was clearly someone who had written C code on the windows platform previously. Googling ...
I have created a .net 2.0 windows application. This application creates form controls dynamically. Now when I am trying to run the application, it is throwing an exception "Error in creating windows ...
I m currently creating a silent print module. The current control I m using is, it s making sure that the control handle is already created (IsHandleCreated). I did everything to cheat this with no ...
I currently debug a multi threaded application, which runs without errors until some functions where called about 2000 times. After that the application stops responding, which I could track down to ...
I have a large old program which has some rather complex graphical displays (all via standard API calls). The program appears to be working fine, but I recently looked at the "handles" field of ...
I m debugging this database project. It wraps access to SQLite for a higher level application. It s designed to run asynchronously, that is, it has methods like ExecuteRequestAsync() and ...
How can we get the handle of a window that doesn t have a title? Is there a way to enumerate all the windows on desktop and filter the window that don t have a title (in my case, there is only one) ...