Is label an attribute of scatter() and lines() in Makie.jl?

I am working on my understanding of the Makie package. In the plot from the help documentation (Legend), different markers get used with their legend labels determined by the label argument. Is this argument considered an attribute? I ask as I do not see it when using help_attributes(scatter) and help_arguments() isn’t currently implemented correctly. If it is an argument and not an attribute, what is the operational difference between attributes and arguments of the plotting function? Is there documentation for the non-attribute arguments? Thanks for helping me further my understanding.

f = Figure()

ax = Axis(f[1, 1])

sc1 = scatter!(randn(10, 2), color = :red, label = "Red Dots")
sc2 = scatter!(randn(10, 2), color = :blue, label = "Blue Dots")
scatter!(randn(10, 2), color = :orange, label = "Orange Dots")
scatter!(randn(10, 2), color = :cyan, label = "Cyan Dots")

axislegend()

axislegend("Titled Legend", position = :lb)

axislegend(ax, [sc1, sc2], ["One", "Two"], "Selected Dots", position = :rb,
    orientation = :horizontal)

f

image

Kind of but not really. What is listed under help_attributes are keyword arguments that modify the plot somehow, like color etc. But you’re not limited to those - you can pass whatever you want as a kwarg and it’ll end up in plot.attributes (like all other attributes). Legends make use of that with label.

1 Like

This part grew a bit organically, we will think about the place for attributes like that which every plot object should have for future refactors. The attributes dict has become a bit messy

1 Like

Thanks! I would never have figured this out on my own.

Gotcha: I think Makie is a tremendously ambitious and cool package. As I learn it, I keep having mental hiccoughs due to some of this organic growth as I try to digest it all, but I do think that will all get resolved in time. Thx!

Yes I definitely understand how some things are confusing from the outside. Often it’s not clear what the best direction to go in is until some approaches are tried “live” and you go on for a couple months. So sometimes this leads to less than ideal implementations just because we don’t want to release breaking versions all the time. But most of these things will get straightened out sooner or later, so feedback from users is very valuable that points us to these issues.

1 Like

Had a similar question here.
How to probe into the parts of a figure, see its components, possible attributes and values?

1 Like