Clear Filters
Clear Filters

Trying to plot weekends only on the X axis.

3 views (last 30 days)
Erick Koenig
Erick Koenig on 28 Nov 2020
Commented: dpb on 28 Nov 2020
Hello, I'm working with a data set that has three values per day on Friday and Saturday. I have 0:00, 8:00 and 16:00 for both days. I would like to plot 8 months worth of those two days. I can get it to work, but there are gaps from the end of Saturday to the beginning of the next Friday. Is there a way to still use the date and time, but eliminate the gaps that occur during the weekdays? Thank you
  4 Comments
Star Strider
Star Strider on 28 Nov 2020
I’m not certain if this is what you’re looking for, however the isweekend function may be worth considering.
dpb
dpb on 28 Nov 2020
" convincing a college professor it can't be done. :) "
I didn't say it can't be done; only that you have to create the appearance by subterfuge. :)
Plot the data against the ordinal number and label the ticks by the week or however is wanted.
Alternatively, you could potentially use the tiledlayout and put each week in the next tile. Unfortunately, again TMW is too clever by far for their own good and doesn't have a default layout in which the axes actually abut.

Sign in to comment.

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!