nc-time-axis icon indicating copy to clipboard operation
nc-time-axis copied to clipboard

Add an example of a(n horribly) wrong plot when NOT using nc-time-axis

Open jypeter opened this issue 1 year ago • 5 comments

📚 Documentation

This is a nice and useful extension of cftime and matplolib!

We spent some time this afternoon with @oliviermarti trying to understand why a time series based on data using a noleap calendar was plotted (seemingly) correctly with default settings, but was shifted (30 years in our case) when we tried to format the tick labels with set_major_formatter, following the appropriate examples in the matplotlib gallery. We were lucky to spot this, because matplotlib was not generating any error! I guess matplotlib was happy enough to handle cftime data as if it was regular datetime data

The question now is how to tell our climate data users that they (or most likely their unsuspecting interns) will get horribly wrong plots if they rely on matplolib defaults...

What could work would be to display side by side a matplotlib plot using some dummy data with a cftime+noleap time axis, and a correct plot using nc-time-axis, if somebody can come up with a simple example (I'm not volunteering!)

jypeter avatar Jan 11 '23 15:01 jypeter