You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function Makie.plot!(plot::Hist{<:Tuple{<:MyHist}})
# Only forward valid attributes for BarPlot
valid_attributes = Makie.shared_attributes(plot, BarPlot)
barplot!(plot, valid_attributes, plot[1])
end
h =MyHist([1, 10, 100], 1:3)
hist(h; color=:red, direction=:x)
Now, let's say user wants to also customize Makie.hist(myhist; clamp_bincounts = ...), they can't get this to work.
In particular, it is not enough to register these:
because by the time we're inside our own function Makie.plot!(plot::Hist{<:Tuple{<:MyHist}}) method, the attributes no longer contain the keyword argument we need.
used_attributes is for passing arguments to convert_arguments, which is where clamp_bincounts should be implemented, since you can't add custom attributes to an existing recipe.
as you may recall, that tutorial specifically deal with situation where it can't be implemented as convert_arguments -- in this case, I already have histograms made, I can't convert them back to inputs to Makie.hist(), it's conceptually impossible.
Building on top of the examples: https://docs.makie.org/dev/tutorials/wrap-existing-recipe
The tutorial has this snippet:
Now, let's say user wants to also customize
Makie.hist(myhist; clamp_bincounts = ...)
, they can't get this to work.In particular, it is not enough to register these:
because by the time we're inside our own
function Makie.plot!(plot::Hist{<:Tuple{<:MyHist}})
method, the attributes no longer contain the keyword argument we need.@asinghvi17
The text was updated successfully, but these errors were encountered: