Closed BeastyBlacksmith closed 4 years ago
I think this is coming from #228, with the two-argument default constructor taking over.
That said, I don't think that technically using the Options
constructor is part of the API we expose so I am not sure this is a bug. I would recommend something like
@pgf { fill => cstr, draw_opacity => a }
Well, when writing the backend @KristofferC advised to not use the @pgf
macro.
Ref: https://github.com/JuliaPlots/Plots.jl/pull/2252#discussion_r346410991
Yes, and I stand by that. :). We should just fix and test the constructor.
**diff --git a/src/options.jl b/src/options.jl
index 61f240e..b04af61 100644
--- a/src/options.jl
+++ b/src/options.jl
@@ -14,7 +14,7 @@ see the [`@pgf`](@ref) convenience macro.
When `print_empty = false` (the default), empty options are not printed. Use
`print_empty = true` to force printing a `[]` in this case.
"""
-function Options(args...; print_empty::Bool = false)
+function Options(args::Union{Pair,MergeEntry}...; print_empty::Bool = false)
d = OrderedDict()
for arg in args
if arg isa Pair
should fix the dispatch I think.
Fair enough; we should also document that
Options
and MergeEntry
are part of the API, and mention that packages building on PGFPlotsX are encouraged to use it,Options
to reflect #228, possibly with examples.MergeEntry
doesn't need to be a part of the official API I think.
Ref: https://github.com/JuliaPlots/Plots.jl/issues/2792
The offending code is
Where
the_plot
is aPGFPlotsX.TikzDocument
.