フィルターのクリア

How to use the function triplot to plot an stl file in a specific axis inside App Designer?

6 ビュー (過去 30 日間)
I want to display a geometry saved in a stl file inside a specific axis in App Designer. When I use the syntax 'triplot(TR)', it displays the geometry in a separate figure.
It is mentioned in the topic Display Graphics in App Designer, that "Some functions (such as imshow and triplot) use a name-value pair argument to specify the target object. For example, this code shows how to call the imshow function in App Designer."
However, I cannot find any relevant name-value pair for triplot. I have tried using the syntax 'triplot(TR,'Parent',app.UIAxes). It does not give any error, but nothing is displayed.
Any solution to this problem is appreciated.
Thanks,
Sreerup
  3 件のコメント
Sreerup Banerjee
Sreerup Banerjee 2021 年 1 月 14 日
Hi Tim! I have used the function 'trisurf'. It fulfilled my need.
Alfin Junaedy
Alfin Junaedy 2021 年 10 月 31 日
Just add 'drawnow'. It worked for me.
triplot(TR,'Parent',app.UIAxes); drawnow;

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

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 1 月 14 日
編集済み: Cris LaPierre 2021 年 1 月 14 日
When plotting in app designer, you need to tell the plotting function what axes to plot into. Although the documentation for triplot and trisurf do not describe this name-value pair, it does work. In an app, you'd use something like app.UIAxes. Below is just a simple example to show the syntax.
ax = axes;
P = rand(10,2);
T = delaunayTriangulation(P);
triplot(T,'Parent',ax)
And for a surface
figure
a2=axes;
[x,y] = meshgrid(1:15,1:15);
z = peaks(15);
T = delaunay(x,y);
trisurf(T,x,y,z,'Parent',a2)

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by