How to remove hh:mm:ss format from app.UIAxes plot?
조회 수: 2 (최근 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
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 Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!