Skip to content

Commit 3d2ba74

Browse files
committed
cleanup
1 parent 0fed793 commit 3d2ba74

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

ext/plots/argmax2d_plots.jl

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
function _init_plot(title="")
1+
function _init_plot(title=""; kwargs...)
22
pl = Plots.plot(;
33
aspect_ratio=:equal,
44
legend=:outerleft,
55
xlim=(-1.1, 1.1),
66
ylim=(-1.1, 1.1),
77
title=title,
8+
kwargs...,
89
)
910
return pl
1011
end
@@ -42,28 +43,23 @@ function _plot_y!(pl, y)
4243
)
4344
end
4445

45-
function _plot_maximizer!(pl, θ, instance, maximizer)
46-
ŷ = maximizer(θ; instance)
47-
return _plot_y!(pl, ŷ)
48-
end
49-
5046
has_visualization(::Argmax2DBenchmark) = true
5147

52-
function plot_instance(::Argmax2DBenchmark, sample::DataSample)
53-
pl = _init_plot()
48+
function plot_instance(::Argmax2DBenchmark, sample::DataSample; kwargs...)
49+
pl = _init_plot(; kwargs...)
5450
_plot_polytope!(pl, sample.instance)
5551
return pl
5652
end
5753

58-
function plot_solution(::Argmax2DBenchmark, sample::DataSample)
59-
pl = _init_plot()
54+
function plot_solution(::Argmax2DBenchmark, sample::DataSample; kwargs...)
55+
pl = _init_plot(; kwargs...)
6056
_plot_polytope!(pl, sample.instance)
6157
_plot_objective!(pl, sample.θ)
6258
return _plot_y!(pl, sample.y)
6359
end
6460

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...)
6763
_plot_polytope!(pl, sample.instance)
6864
_plot_objective!(pl, θ)
6965
return _plot_y!(pl, y)

test/code.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
DecisionFocusedLearningBenchmarks;
55
ambiguities=false,
66
deps_compat=(check_extras = false),
7-
stale_deps=(ignore=[:LaTeXStrings],),
7+
stale_deps=(ignore=[:LaTeXStrings],), # used only inside DFLBenchmarksPlotsExt
88
)
99
end
1010

0 commit comments

Comments
 (0)