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

2 Ansichten (letzte 30 Tage)
rbme17
rbme17 am 4 Dez. 2019
Kommentiert: Adam Danz am 4 Dez. 2019
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 Kommentar
Adam Danz
Adam Danz am 4 Dez. 2019
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).

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by