简体   繁体   English

MATLAB GUI以及图形和轴

[英]MATLAB gui and figure and axes

I have an iso-surface and a scatter3 objects. 我有一个等值面和一个scatter3对象。 I want to merge them into the axes object of the GUI. 我想将它们合并到GUI的axes对象中。 How do I do that? 我怎么做? It looks like I can keep only one children in an axes object. 看来我只能在一个axis对象中保留一个孩子。

I also settled for opening a new figure from the GUI which contains the two objects, but it seems that the figure inherits the properties of the GUI! 我还决定从包含两个对象的GUI中打开一个新图形,但是该图形似乎继承了GUI的属性!

base = patch(isosurface(atlas,0));
isonormals(atlas,base);
...
hold on;
...
scatter3(L(:,2)', L(:,1)', L(:,3)', L(:,4)', L(:,5)', '.');

And the result is just the scatter3 plot. 结果就是scatter3图。 Same thing if I write 如果我写的话也是一样

points = scatter3(L(:,2)', L(:,1)', L(:,3)', L(:,4)', L(:,5)', '.');
set( handles.axes, 'Children', [base, points]);

UPDATE I tried to write an independent function (outside the GUI function) to generate the figure I want. UPDATE我试图编写一个独立的函数(GUI函数之外)以生成所需的图形。 If I call that procedure from the GUI it doesn't work, but if I call that procedure from the MATLAB console, it works. 如果我从GUI调用该过程,则无法使用,但如果从MATLAB控制台调用该过程,则它可以运行。

PS the waitbar looks like this PS的服务栏看起来像这样

等候栏

Is this normal? 这正常吗?

I'm not sure if this is what you're looking for, but try plotting one, then use the " hold on " command, then plot the other. 我不确定这是否是您要寻找的,但是尝试绘制一个,然后使用“ hold on ”命令,再绘制另一个。 That should plot the second one without erasing the first. 那应该画出第二个而不擦除第一个。 Is that what you're asking to do? 这就是你要做什么吗?

Ok solved. 好了,解决了。 It was the waitbar which interfered with the GUI. 正是等待栏干扰了GUI。

Apparently, hold on was plotting the isosurface on the waitbar. 显然,要等一下在等待栏上绘制等值面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM