From 80fd0a9f5fcf43ba9eee0cf8420011e76bc9d72d Mon Sep 17 00:00:00 2001 From: Eric Gourgoulhon Date: Tue, 19 Sep 2023 11:53:37 +0200 Subject: [PATCH] Fix options in region_plot --- src/sage/plot/contour_plot.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py index 7a8be38979b..9c70ebd3e49 100644 --- a/src/sage/plot/contour_plot.py +++ b/src/sage/plot/contour_plot.py @@ -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 @@ -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] @@ -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)