How to do cla reset UIAxes in ML2021a

37 次查看(过去 30 天)
Until MatLab 2020a I used to code this to reset the axes of a plot in AppDesigner code:
app.UIAxes.cla('reset');
but unfortunately in MatLab 2021a this command doesn't work anymore. How can I do the same in R2021a?
Thanks! :)

采纳的回答

Adam Danz
Adam Danz 2021-5-12
On what version of Matlab has that syntax ever worked? Even on regular axes, the error message appear.
fig = figure('Visible','off'); % visible=off to simplify the display
ax = axes(fig);
ax.cla
Unrecognized method, property, or field 'cla' for class 'matlab.graphics.axis.Axes'.
Instead, use
cla(app.UIAxes, 'reset')
  1 个评论
endystrike
endystrike 2021-5-12
编辑:endystrike 2021-5-12
cla(app.UIAxes, 'reset');
Adam your code works perfectly in 2021a, thanks a lot! :)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by