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

조회 수: 61 (최근 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 CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by