Skip to content

Commit

Permalink
Fix options in region_plot
Browse files Browse the repository at this point in the history
  • Loading branch information
egourgoulhon committed Sep 19, 2023
1 parent 80f6d77 commit 80fd0a9
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 80fd0a9

Please sign in to comment.