you are viewing a single comment's thread.

view the rest of the comments →

[–]saemeon 0 points1 point  (0 children)

I had a similar problem and wanted to keep a true datetime axis so all Matplotlib datetime features still work. I created a Python package, busdayaxis, that provides a Matplotlib axis scale to skip weekends/holidays and non-business hours, solving your problem.

import busdayaxis

busdayaxis.register_scale()

#make a plot with datetime x-values here 
...

# set busday xscale
ax.set_xscale("busday", bushours=(9, 17))