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

106 次查看(过去 30 天)
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.

请先登录,再进行评论。

更多回答(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