Makie.jl
Makie.jl copied to clipboard
What is the relationship between theme and attributes?
Hi,
I was wondering what is the relationship between theme and attributes. For example, if I update one of the Attributes in attribute do the attributes in theme get update as well?
Best,
Can you give an example code sample of what you mean?
@SimonDanisch There is not much to go by from the docs when defining recipes. It only uses either Theme
or Attributes
, never both.
For example if I want a recipe that uses both a Theme
and Attributes
I would expect something like this to work
@recipe(MyPlot) do scene
Theme(
a = :red
)
Attributes(
b = :blue
)
end
But it does not. I can not access both myplot.a
and myplot.b
in the plot!
function. This should be somehow specified in the docs. Is there a way how to use both? I can then add it to the docs.
Theme is just a shorthand for Attributes. I think it was introduced because we were planning on moving away from Attributes, but I'm not 100% sure.
julia> Theme
Attributes
julia> Attributes
Attributes
julia> Theme == Attributes
true
To answer your question, the preferred route is to just use Theme.
OK then. Thank you. I will change Attributes
in the documentation to avoid more confusion then and submit a PR. Then this issue can maybe be closed?
I don't know why it included the other commits... Why is this?
this is such a foot gun, have we decided what to use? if so we should remove all Attributes
in docs at least, and throw a deprecation in code, I can do it