How to represent (0:10:35) as 00:00 00:10, ... in Yticklabel?
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Axis Labels dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
