How to remove hh:mm:ss format from app.UIAxes plot?

1 次查看(过去 30 天)
Hi everyone,
I have a GUI where I plot some data over time and am using hh:mm:ss as the time format on the x-axis in app designer. When I tried plotting a histogram to app.UIAxes, I received an error since the hhmmss hasn't been removed: Error using histogram; Values plotted against x-axis must be duration values. To create duration values, use the DURATION function.
I tried the following, but with no success:
cla(app.UIAxes); % Doesn't clear the xaxis
cla(app.UIAxes, 'reset'); % NO BUENO - clears too much!
app.UIAxes.XAxis.TickLabelFormat = '%g'; % This is what it was originally before any plotting
% Error: Error using matlab.graphics.axis.decorator.DurationRuler/set.TickLabelFormat Value must be a duration format.'
Does anyone know how to change the format of the xaxis back to normal without resetting the the UIAxes?
  1 个评论
Adam Danz
Adam Danz 2019-12-4
I'm not convinced that the TickLabelFormat is the problem (although, it could be).
Have you tried following the suggestion in the error? Are your x-values in histrogram() durations?
Perhaps a bit of reproducible code would be helpful (not the entire App code, just enough to reporduce the problem).

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by