Can you convert DatetimeRuler to DurationRuler?
I have a series of utilities that generate figures like:
fh = figure;
ax = axes(fh);
plot(ax, datetime("now")+minutes(1:5), 1:5, "–x");
Which use datetime objects for the XData (and therefore have a DatetimeRuler for the x-axis) because it makes it easier to find reference data in the future.
However, for presentations, I generally want plots that use a DurationRuler for the sake of clarity. Is there any way to update ax.XAxis (or maybe even all of the ax.Children entries) such that I could have figures that look like they were generated like this instead:
fh = figure;
ax = axes(fh);
plot(ax, minutes(1:5), 1:5, "–x");
I could update all the plotting utilities to optionally use Duration objects from some reference but this would effect several utilities and it would be more convenient to just pass an axis or figure handle to some function that could do the conversion after the figure exists.I have a series of utilities that generate figures like:
fh = figure;
ax = axes(fh);
plot(ax, datetime("now")+minutes(1:5), 1:5, "–x");
Which use datetime objects for the XData (and therefore have a DatetimeRuler for the x-axis) because it makes it easier to find reference data in the future.
However, for presentations, I generally want plots that use a DurationRuler for the sake of clarity. Is there any way to update ax.XAxis (or maybe even all of the ax.Children entries) such that I could have figures that look like they were generated like this instead:
fh = figure;
ax = axes(fh);
plot(ax, minutes(1:5), 1:5, "–x");
I could update all the plotting utilities to optionally use Duration objects from some reference but this would effect several utilities and it would be more convenient to just pass an axis or figure handle to some function that could do the conversion after the figure exists. I have a series of utilities that generate figures like:
fh = figure;
ax = axes(fh);
plot(ax, datetime("now")+minutes(1:5), 1:5, "–x");
Which use datetime objects for the XData (and therefore have a DatetimeRuler for the x-axis) because it makes it easier to find reference data in the future.
However, for presentations, I generally want plots that use a DurationRuler for the sake of clarity. Is there any way to update ax.XAxis (or maybe even all of the ax.Children entries) such that I could have figures that look like they were generated like this instead:
fh = figure;
ax = axes(fh);
plot(ax, minutes(1:5), 1:5, "–x");
I could update all the plotting utilities to optionally use Duration objects from some reference but this would effect several utilities and it would be more convenient to just pass an axis or figure handle to some function that could do the conversion after the figure exists. plotting, axes, datetime MATLAB Answers — New Questions