improved implementation of date ranges in matplotlib