You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The automatic quickplot time label is unrelated to the printed time ticks and even to native cube units
Minimum Reproducible Code
Any spatio-temporal cube will do; I've saved an example of Pacific SST from a pre-Industrial control run using years 1191-1200, attached it below (be sure to remove .txt from the name): sst_example.nc.txt
importirisimportiris.quickplotasqpltimportesmvalcore.preprocessorasppex=iris.load_cube('sst_example.nc')
m_ex=pp.meridional_statistics(ex, operator='mean')
qplt.pcolormesh(m_ex)
#prints native units of cubeTime=m_ex.coord('time')
time_meta_data=Time.metadata.unitsCalendar=time_meta_data.calendarU=time_meta_data.cftime_unitprint(U)
print(max(Time.points))
Expected behaviour
The native units of the cube m_ex are days since 1850-1-1 00:00:00 (see printed output in the screenshot below), and the values are incredibly large negative numbers (the largest time value is -237266.5). However, I do not expect to see tick labels in days relative to some offset, but in absolute time presented in years, ranging from 1191 to 1200. I thus expect the time axis to be labelled Year, or Time / Year
Observed behavior
The time ticks appear as expected, as all are between 1191 and 1200. However, the automatic label says Time / days since 1970-01-01. This is clearly not consistent with the time ticks because the presented numbers of in units of years with no time offset. Furthermore, t's completely unclear where the offset in the label came from, since the native offset of the cube being plotted (m_ex) is 1850. I wonder if these units have been hard-coded somewhere?
The text was updated successfully, but these errors were encountered:
and I agree that specifying the units like this is misleading. Note that if you zoom in enough on your plot, you will no longer see years but Matplotlib automatically starts showing the dates in YYYY-MM-DD format. I do not think there is an easy way to make the label reflect that. So maybe it would be best to just not specify a unit here, which is what happens if you make a line plot rather than a pcolormesh:
#616 removed the unit for the 1D plots. I guess something else developed in the meantime to make the 2D plot ticks use Matplotlib’s date formatter, but the label has not been updated to match.
🐛 Bug Report
The automatic quickplot time label is unrelated to the printed time ticks and even to native cube units
Minimum Reproducible Code
Any spatio-temporal cube will do; I've saved an example of Pacific SST from a pre-Industrial control run using years 1191-1200, attached it below (be sure to remove
.txt
from the name):sst_example.nc.txt
Expected behaviour
The native units of the cube
m_ex
aredays since 1850-1-1 00:00:00
(see printed output in the screenshot below), and the values are incredibly large negative numbers (the largest time value is-237266.5
). However, I do not expect to see tick labels in days relative to some offset, but in absolute time presented in years, ranging from 1191 to 1200. I thus expect the time axis to be labelledYear
, orTime / Year
Observed behavior
The time ticks appear as expected, as all are between 1191 and 1200. However, the automatic label says
Time / days since 1970-01-01
. This is clearly not consistent with the time ticks because the presented numbers of in units of years with no time offset. Furthermore, t's completely unclear where the offset in the label came from, since the native offset of the cube being plotted (m_ex
) is1850
. I wonder if these units have been hard-coded somewhere?The text was updated successfully, but these errors were encountered: