Is it possible to draw clustergram on UIAxes in app designer?

1 回表示 (過去 30 日間)
Mohammad Shahbazy
Mohammad Shahbazy 2021 年 8 月 29 日
コメント済み: Cris LaPierre 2021 年 8 月 30 日
Hi All,
I tried the following code to draw clustergram over UIAxes, but it does not work.
X = rand(20,10);
app.UIFigure.HandleVisibility = 'on';
set(0, 'CurrentFigure', app.UIFigure);
set(app.UIFigure,'CurrentAxes',app.UIAxes);
cgo = clustergram(X);
app.UIFigure.HandleVisibility = 'off';
Would you please guide me to resolve this code?
Thanks

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 8 月 30 日
Part of the challenge is that clustergram creates its own figure window rather than looking for one to plot into.
Here's something that worked for me, but it means the only thing the app can show is the clustergram, as it takes over the entire app figure.
X = rand(20,10);
cgo = clustergram(X);
plot(cgo,app.UIFigure)
Also note that a separate figure window with the clustergram still appears. if you want to stop that from happening, see this answer.
  2 件のコメント
Mohammad Shahbazy
Mohammad Shahbazy 2021 年 8 月 30 日
Many thanks for your reply @Cris LaPierre
I need to keep this over the app.UIAxes window. I thought to save it as either *tiff or *png, then reading by imshow, might be another option. But I can't save as the output of clustergram with keeping original form (heatmap+dendrogram), because what you recommend as a fix (to disapear the figure) removes dendrogram from plot. I stiil need something to prevent appearing clustergram figure window. Do you have any suggestion?
Cris LaPierre
Cris LaPierre 2021 年 8 月 30 日
I am not aware of a way of preventing clustergram from creating a figure. However, if you read through the answer I linked to, someone there proposes a solution.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Management についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by