How to represent (0:10:35) as 00:00 00:10, ... in Yticklabel?
Show older comments
Hi,
I am facing a trouble in putting yticklabels in on my plot.
I have time in hours with 10-minutes gap (0:0.1667:0.51). I want to put labels saying 00:00, 00:10, 00:20 and 00:30 in my xticklabels. I tried following but none works!
set(gca,'YTick',(0:0.1667:0.51),'LineWidth',1.5,'FontWeight','bold',... % 0.1667 = 10-min
'FontSize',14,'YTickLabel',...
(0:10:35));
ytick3 = (0:10:35);
yticklab = datestr(minutes(ytick3),'HH:MM');
set(gca,'YTick',ytick3,'YTickLabel',yticklab);
% ytickformat('mm:ss') % alternative
% datetick('y','HH:MM:SS','keeplimits'); % alternative
Any suggetsions what is going wrong?
Thank you in advance
Accepted Answer
More Answers (0)
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!