How can I show the time on Y axis on Bar graph or Stem graph with datetick ?

1 view (last 30 days)
Hello,
I have a 20x1 cell array and on each cell there is a time in 'MM:SS.FFF'.
I use datenum to convert it in serial number. Now I would like to use a bar graph or stem graph with numeric values in X axis and those time values in Y Axis.
I use datetick after the plot to convert the value in time text but on my graph there is just '00:00.000' on the Y-axis and if I try to plot in plot graph it's working (I have my time values on Y axis).
My code is (with 'h' a 20x1 cell with time values in text):
Format = 'MM:SS.FFF';
z=[1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21];
h1= datenum(h,Format);
bar(z,h1)
datetick('y',Format)
Do you have a solution for this problem?
Thank you,
Martin

Answers (0)

Categories

Find more on Line Plots 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!