Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Problem
The default matplotlib date/time axes are difficult to customize to look professional. Date values usually denote time intervals (days, months, years), but matplotlib default date labels are attached to single ticks that mark the start of that interval. And since all date/time annotations are usually put on a single axis, the labels get long, and often have to be plotted at an angle, which does not look pleasing and makes the plots more difficult to read.
Proposed solution
Good-looking and easy to read date/time axes need implementation of two features:
- Interval labels - where the labels for years, months, week numbers and days are drawn between two adjacent tick marks
- Primary and secondary axes that are vertically stacked, so that the top ticks/labels can denote a smaller unit of time than the bottom one.
Some excellent examples of the look that can be achieved using these two features can be seen in the cookbook of the Generic Mapping Tools:https://docs.generic-mapping-tools.org/latest/cookbook/options.html#cartesian-time-axes
The "interval labels" feature could also be made reusable for custom interval annotations, like in the further example on that website:https://docs.generic-mapping-tools.org/latest/cookbook/options.html#custom-axes