Is it possible to set the xlabel, ylabel and zlabel within a Makie recipe?
I am finishing a recipe for biplots, but can’t figure out how to set the labels of the axes to contain the variance explained. I would like to write Dim 1 (90%) in the xlabel for example:
I had the same question - unfortunately this thread is the first hit on google.
For those looking for the same answer:
Apparently what we want to do is not possible (yet, as of Jan 2023) as Makie recipes work on the “plot object level”, whereas the functions we want to use (ylabel!() etc) expect an Axis.
The closest I found is to provide an axis keyword to the recipe, which isn’t ideal.
Assuming biplot() is generated by a recipe, you should be able to do:
biplot(... ; axis=(ylabel="My Y-Axis label",))
Otherwise, it seems we have to define a custom plot function to do what we want, as suggested by @jules
ax.ylabel =... is official api, not a workaround. We’ve not decided what attributes need additional setter functions, xlabel! and ylabel! used to work for different objects and weren’t updated. Not sure if it’s worth bringing them back if they do the same.
Incidentally, if this is the official API, I ask that the docs for xlabel! and cousins be updated, as they are incorrect and the cause of the confusion above: