Skip to content

Commit 1f6627a

Browse files
authored
Parse with packaging version (#3815)
1 parent 2c5cdfb commit 1f6627a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/iris/quickplot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
1414
"""
1515

16+
from packaging import version
17+
1618
import cf_units
17-
from matplotlib import __version__ as mpl_version
19+
from matplotlib import __version__ as _mpl_version
1820
import matplotlib.pyplot as plt
1921

2022
import iris.config
@@ -49,7 +51,7 @@ def _title(cube_or_coord, with_units):
4951
units = units.symbol
5052
if units.is_time_reference():
5153
# iris.plot uses matplotlib.dates.date2num, which is fixed to the below unit.
52-
if mpl_version >= "3.3":
54+
if version.parse(_mpl_version) >= version.parse("3.3"):
5355
days_since = "1970-01-01"
5456
else:
5557
days_since = "0001-01-01"

0 commit comments

Comments
 (0)