Skip to content

Commit 461727b

Browse files
author
Release Manager
committed
gh-36296: remove duplicate args in @options() in region_plot This is needed for Sphinx 7.1+, as outlined in #36295 and discovered in #36276 This will resolve #36295 It also fixes a bug in `region_plot`, where in some cases `plot_points` were not passed to the backend. URL: #36296 Reported by: Dima Pasechnik Reviewer(s): Dima Pasechnik, Kwankyu Lee, Michael Orlitzky
2 parents 653bd9f + b7c6367 commit 461727b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/sage/plot/contour_plot.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,7 @@ def f(x,y):
13941394
@options(plot_points=100, incol='blue', outcol=None, bordercol=None,
13951395
borderstyle=None, borderwidth=None, frame=False, axes=True,
13961396
legend_label=None, aspect_ratio=1, alpha=1)
1397-
def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol,
1398-
borderstyle, borderwidth, alpha, **options):
1397+
def region_plot(f, xrange, yrange, **options):
13991398
r"""
14001399
``region_plot`` takes a boolean function of two variables, `f(x, y)`
14011400
and plots the region where f is True over the specified
@@ -1659,6 +1658,14 @@ def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol,
16591658
from warnings import warn
16601659
import numpy
16611660

1661+
plot_points = options['plot_points']
1662+
incol = options.pop('incol')
1663+
outcol = options.pop('outcol')
1664+
bordercol = options.pop('bordercol')
1665+
borderstyle = options.pop('borderstyle')
1666+
borderwidth = options.pop('borderwidth')
1667+
alpha = options.pop('alpha')
1668+
16621669
if not isinstance(f, (list, tuple)):
16631670
f = [f]
16641671

@@ -1677,9 +1684,9 @@ def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol,
16771684
if neqs and not bordercol:
16781685
bordercol = incol
16791686
if not f:
1680-
return implicit_plot(feqs[0], xrange, yrange, plot_points=plot_points,
1681-
fill=False, linewidth=borderwidth,
1682-
linestyle=borderstyle, color=bordercol, **options)
1687+
return implicit_plot(feqs[0], xrange, yrange, fill=False,
1688+
linewidth=borderwidth, linestyle=borderstyle,
1689+
color=bordercol, **options)
16831690
f_all, ranges = setup_for_eval_on_grid(feqs + f,
16841691
[xrange, yrange],
16851692
plot_points)

0 commit comments

Comments
 (0)