フィルターのクリア

How to create a patch object without actually plotting it.

14 ビュー (過去 30 日間)
luc
luc 2015 年 5 月 1 日
コメント済み: luc 2015 年 5 月 1 日
Hello everyone!
I have some data, say [X,Y,Z] and when I use the Patch command it creates a figure and gives me a shape.
I would like to supress the actual figure, and make the code display it later on.
My two problems are: 1) How do I supress the plotting of the patch? 2) How do I display a patch object in a new figure?
Thanks in advance!

採用された回答

pfb
pfb 2015 年 5 月 1 日
h=patch(X,Y,Z,'r','visible','off');
and then, when you need it
set(h,'visible','on');
  3 件のコメント
luc
luc 2015 年 5 月 1 日
Okay, the visibility off worked well, the part where I display it.. not that much.
My current code
Patch_s=patch(XXX_s,YYY_s,ZZZ_s,1,'visible','off');
if m==1
fv_combined1=Patch_s;
end
nv1=length(fv_combined1.Vertices);
fv_combined1.Vertices=[fv_combined1.Vertices;Patch_s.Vertices];
fv_combined1.Faces=[fv_combined1.Faces; Patch_s.Faces+nv1];
This is placed in a loop where I update the patch figure "fv_combined1" via its vertices and Faces.
I can't the code to display the fv_combined1.
figure(1)
copyobj(fv_combined1,1)
set(fv_combined1,'visible','on');
set(Patch_s,'visible','on');
This does not work :(
It gives me this error:
Error using copyobj
Patch cannot be a child of Figure.
Error in patchobjecttest (line 92)
copyobj(fv_combined1,1)
luc
luc 2015 年 5 月 1 日
Ignore comment. I removed the copyobject and everything was fine!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by