Box Plot for Time (HH:MM:SS) data

10 views (last 30 days)
Ganesh Naik
Ganesh Naik on 17 Apr 2021
Commented: Ganesh Naik on 20 Apr 2021
Hi all, I am trying to get the boxplot for Time (HH:MM:SS) and day name data but unable to get the required plot. In detail, I would like to get the Boxplot in terms of days, (Monday to Sunday). I have attached the sample data and any help in this regard is highly appreciated.
Cris LaPierre
Cris LaPierre on 18 Apr 2021
Yes, with numeric data, you can calculate medians and standard deviations. It looks like your data is a character array, meaning it is text. See Jonas' suggestion below.

Sign in to comment.

Accepted Answer

Jonas on 18 Apr 2021
i suggest to convert you time (Hour : Minute : Seconds) to seconds using
[~, ~, ~, H, MN, S]=datevec('14:35:22','HH:MM:SS');
then doing you boxplot thing and then converting your boxplot y labels back to a timestring
Ganesh Naik
Ganesh Naik on 20 Apr 2021
Hi Jonas, thanks for your help. I am going to accept the answer.

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by