Skip to content

Commit

Permalink
gh-36296: remove duplicate args in @options() in region_plot
Browse files Browse the repository at this point in the history
    
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
  • Loading branch information
Release Manager committed Sep 22, 2023
2 parents 653bd9f + b7c6367 commit 461727b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/sage/plot/contour_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,7 @@ def f(x,y):
@options(plot_points=100, incol='blue', outcol=None, bordercol=None,
borderstyle=None, borderwidth=None, frame=False, axes=True,
legend_label=None, aspect_ratio=1, alpha=1)
def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol,
borderstyle, borderwidth, alpha, **options):
def region_plot(f, xrange, yrange, **options):
r"""
``region_plot`` takes a boolean function of two variables, `f(x, y)`
and plots the region where f is True over the specified
Expand Down Expand Up @@ -1659,6 +1658,14 @@ def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol,
from warnings import warn
import numpy

plot_points = options['plot_points']
incol = options.pop('incol')
outcol = options.pop('outcol')
bordercol = options.pop('bordercol')
borderstyle = options.pop('borderstyle')
borderwidth = options.pop('borderwidth')
alpha = options.pop('alpha')

if not isinstance(f, (list, tuple)):
f = [f]

Expand All @@ -1677,9 +1684,9 @@ def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol,
if neqs and not bordercol:
bordercol = incol
if not f:
return implicit_plot(feqs[0], xrange, yrange, plot_points=plot_points,
fill=False, linewidth=borderwidth,
linestyle=borderstyle, color=bordercol, **options)
return implicit_plot(feqs[0], xrange, yrange, fill=False,
linewidth=borderwidth, linestyle=borderstyle,
color=bordercol, **options)
f_all, ranges = setup_for_eval_on_grid(feqs + f,
[xrange, yrange],
plot_points)
Expand Down

0 comments on commit 461727b

Please sign in to comment.