void-packages/srcpkgs/sagemath/patches/trac-34668-matplotlib_3.6-5...

73 lines
3.1 KiB
Diff
Raw Normal View History

commit 5501e0de0dca1cff0355326dd42bd8c7e5749568
Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Date: Tue Oct 11 17:25:04 2022 -0300
Support matplotlib 3.6
diff --git a/src/sage/plot/arc.py b/src/sage/plot/arc.py
index bb834763afc..f65973bcbd5 100644
--- a/src/sage/plot/arc.py
+++ b/src/sage/plot/arc.py
@@ -273,9 +273,9 @@ class Arc(GraphicPrimitive):
p = patches.Arc((self.x, self.y),
2. * self.r1,
2. * self.r2,
- fmod(self.angle, 2 * pi) * (180. / pi),
- self.s1 * (180. / pi),
- self.s2 * (180. / pi))
+ angle=fmod(self.angle, 2 * pi) * (180. / pi),
+ theta1=self.s1 * (180. / pi),
+ theta2=self.s2 * (180. / pi))
return p
def bezier_path(self):
diff --git a/src/sage/plot/ellipse.py b/src/sage/plot/ellipse.py
index a77e6fe640a..c35bed574ef 100644
--- a/src/sage/plot/ellipse.py
+++ b/src/sage/plot/ellipse.py
@@ -192,7 +192,8 @@ class Ellipse(GraphicPrimitive):
options = self.options()
p = patches.Ellipse(
(self.x,self.y),
- self.r1*2.,self.r2*2.,self.angle/pi*180.)
+ self.r1*2.,self.r2*2.,
+ angle=self.angle/pi*180.)
p.set_linewidth(float(options['thickness']))
p.set_fill(options['fill'])
a = float(options['alpha'])
diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
index e779e1210e3..8d620b5c625 100644
--- a/src/sage/plot/graphics.py
+++ b/src/sage/plot/graphics.py
@@ -2007,7 +2007,7 @@ class Graphics(WithEqualityById, SageObject):
We can also do custom formatting if you need it. See above for full
details::
- sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex")
+ sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") # not tested (broken with matplotlib 3.6)
Graphics object consisting of 1 graphics primitive
This is particularly useful when setting custom ticks in multiples
@@ -2341,7 +2341,7 @@ class Graphics(WithEqualityById, SageObject):
sage: subplot = Figure().add_subplot(111)
sage: p._objects[0]._render_on_subplot(subplot)
sage: p._matplotlib_tick_formatter(subplot, **d)
- (<AxesSubplot:>,
+ (<AxesSubplot:...>,
<matplotlib.ticker.MaxNLocator object at ...>,
<matplotlib.ticker.MaxNLocator object at ...>,
<matplotlib.ticker.ScalarFormatter object at ...>,
diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py
index b36ee57227c..5301a05c3dc 100644
--- a/src/sage/plot/plot.py
+++ b/src/sage/plot/plot.py
@@ -1741,7 +1741,7 @@ def plot(funcs, *args, **kwds):
::
- sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex")
+ sage: plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],2],tick_formatter="latex") # not tested (broken with matplotlib 3.6)
Graphics object consisting of 1 graphics primitive
.. PLOT::