|
1 | | -function _init_plot(title="") |
| 1 | +function _init_plot(title=""; kwargs...) |
2 | 2 | pl = Plots.plot(; |
3 | 3 | aspect_ratio=:equal, |
4 | 4 | legend=:outerleft, |
5 | 5 | xlim=(-1.1, 1.1), |
6 | 6 | ylim=(-1.1, 1.1), |
7 | 7 | title=title, |
| 8 | + kwargs..., |
8 | 9 | ) |
9 | 10 | return pl |
10 | 11 | end |
@@ -42,28 +43,23 @@ function _plot_y!(pl, y) |
42 | 43 | ) |
43 | 44 | end |
44 | 45 |
|
45 | | -function _plot_maximizer!(pl, θ, instance, maximizer) |
46 | | - ŷ = maximizer(θ; instance) |
47 | | - return _plot_y!(pl, ŷ) |
48 | | -end |
49 | | - |
50 | 46 | has_visualization(::Argmax2DBenchmark) = true |
51 | 47 |
|
52 | | -function plot_instance(::Argmax2DBenchmark, sample::DataSample) |
53 | | - pl = _init_plot() |
| 48 | +function plot_instance(::Argmax2DBenchmark, sample::DataSample; kwargs...) |
| 49 | + pl = _init_plot(; kwargs...) |
54 | 50 | _plot_polytope!(pl, sample.instance) |
55 | 51 | return pl |
56 | 52 | end |
57 | 53 |
|
58 | | -function plot_solution(::Argmax2DBenchmark, sample::DataSample) |
59 | | - pl = _init_plot() |
| 54 | +function plot_solution(::Argmax2DBenchmark, sample::DataSample; kwargs...) |
| 55 | + pl = _init_plot(; kwargs...) |
60 | 56 | _plot_polytope!(pl, sample.instance) |
61 | 57 | _plot_objective!(pl, sample.θ) |
62 | 58 | return _plot_y!(pl, sample.y) |
63 | 59 | end |
64 | 60 |
|
65 | | -function plot_solution(::Argmax2DBenchmark, sample::DataSample, y; θ=sample.θ) |
66 | | - pl = _init_plot() |
| 61 | +function plot_solution(::Argmax2DBenchmark, sample::DataSample, y; θ=sample.θ, kwargs...) |
| 62 | + pl = _init_plot(; kwargs...) |
67 | 63 | _plot_polytope!(pl, sample.instance) |
68 | 64 | _plot_objective!(pl, θ) |
69 | 65 | return _plot_y!(pl, y) |
|
0 commit comments