필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
rbme17
rbme17 2019년 12월 4일
댓글: Adam Danz 2019년 12월 4일
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