implemented better solution of matplotlib date range