I am confused by what exactly are “attributes” in Makie and how to figure out which ones exist and can be modified.
for plot objects, this seems relatively straightforward (especially coming from a Matlab background). There is a color
attribute, and
I can change it when calling the function with a keyword argument, or after the fact with plt.thenameoftheattribute
:
using CairoMakie
fig, ax, plt = lines([1, 2, 3], [10, 11, 12], color=:red)
display(fig)
# The plot is red
plt.color = :blue
display(fig)
# The plot is now blue
I can even get a list of all attributes by typing plt.attributes
, and they are shown by typing help(lines)
. Not if I type ?lines
, but that’s a minor complaint.
Now to the puzzling stuff…
The axis and the figure also have attributes, at least that’s what this page says. It also says the axis attributes are listed by typing help(Axis)
, but that doesn’t work.
I understand from that page that the axis has a title property (attribute?), and I can indeed add a title with:
ax.title = "My title"
And the Julia REPL is nice, if I type ax. (+TAB)
it proposes a long list of attributes.
But then why does ax.attributes
fail?
Even more puzzling, the figure “attributes” (are they really attributes?) can be changed when calling Figure()
, e.g. with fig = Figure(resolution = 600)
. But I can’t seem to be able to access them afterwards.
Things like fig.resolution
fail, and fig. (+TAB)
in the REPL, I see there is an “attributes”, but fig.attributes
gives nothing. How can I access figure “attributes” (or “properties”) such as resolution
after creating a figure?
I think I am missing some basic understanding of attributes in Makie. I realize it should be possible to get the plots I want (or more or less) by picking relevant parts from the examples at https://makie.juliaplots.org and from some instructions found at Data Visualization with Makie.jl - Julia Data Science, but I would feel more comfortable if I understand how the whole “attributes” thing works.
Thanks for any pointers!