void-packages/srcpkgs/sagemath/patches/36279-matplotlib_3.8.0.patch
Gonzalo Tornaría 5d8e4da91f sagemath: patch and rebuild for ecl-23.9.9
Also add a patch to support matplotlib 3.8.0
2023-09-23 00:06:22 +02:00

25 lines
987 B
Diff

diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
index 59f10f6b13f..adcccff059b 100644
--- a/src/sage/plot/graphics.py
+++ b/src/sage/plot/graphics.py
@@ -36,6 +36,7 @@
# ****************************************************************************
import os
+from numbers import Integral
from collections.abc import Iterable
from math import isnan
import sage.misc.verbose
@@ -2874,6 +2875,11 @@ def matplotlib(self, filename=None,
weight=lopts.pop('font_weight', 'medium'),
variant=lopts.pop('font_variant', 'normal'))
color = lopts.pop('back_color', 'white')
+ if 'loc' in lopts:
+ loc = lopts['loc']
+ if isinstance(loc, Integral):
+ # matplotlib 3.8 doesn't support sage integers
+ lopts['loc'] = int(loc)
leg = subplot.legend(prop=prop, **lopts)
if leg is None:
from warnings import warn