Skip to content

Commit 92a8a96

Browse files
committed
Support for matplotlib-3.8.0
1 parent 80f6d77 commit 92a8a96

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sage/plot/graphics.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# ****************************************************************************
3737

3838
import os
39+
from numbers import Integral
3940
from collections.abc import Iterable
4041
from math import isnan
4142
import sage.misc.verbose
@@ -2874,6 +2875,11 @@ def matplotlib(self, filename=None,
28742875
weight=lopts.pop('font_weight', 'medium'),
28752876
variant=lopts.pop('font_variant', 'normal'))
28762877
color = lopts.pop('back_color', 'white')
2878+
if 'loc' in lopts:
2879+
loc = lopts['loc']
2880+
if isinstance(loc, Integral):
2881+
# matplotlib 3.8 doesn't support sage integers
2882+
lopts['loc'] = int(loc)
28772883
leg = subplot.legend(prop=prop, **lopts)
28782884
if leg is None:
28792885
from warnings import warn

0 commit comments

Comments
 (0)