How can I set "legend" and "text" to an UIAxes? (app designer)

35 ビュー (過去 30 日間)
Giulia Di Giorgio
Giulia Di Giorgio 2023 年 3 月 12 日
コメント済み: Giulia Di Giorgio 2023 年 3 月 12 日
Hello, which functions can I use to include legend and text in my App plot? The version for regular code is this one:
legend('datos','ajuste',"location","best");text(10,0.155,strcat('R²= ',Rcuadrado))

採用された回答

Cameron
Cameron 2023 年 3 月 12 日
編集済み: Cameron 2023 年 3 月 12 日
You need to specify the axes within App Designer. Try this:
%use whatever your UIAxes name is. I assumed it was app.UIAxes
legend(app.UIAxes,'datos','ajuste',"location","best");
text(app.UIAxes,10,0.155,strcat('R²= ',Rcuadrado))
  3 件のコメント
Voss
Voss 2023 年 3 月 12 日
The text is placed at the point (10,0.155). The point (10,0.155) is outside the limits of the axes. That's why you don't see the text.
Giulia Di Giorgio
Giulia Di Giorgio 2023 年 3 月 12 日
You're right, thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by