Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting axis labels and title in a plot recipe #4692

Closed
irregular-rhomboid opened this issue Dec 26, 2024 · 2 comments
Closed

Setting axis labels and title in a plot recipe #4692

irregular-rhomboid opened this issue Dec 26, 2024 · 2 comments

Comments

@irregular-rhomboid
Copy link

I'm currently writing R-style plots for GLM.jl (JuliaStats/GLM.jl#581), and had issues setting the axis labels and title for my plots. The current brittle solution I'm using is getting the axis with current_axis, but this won't work if the axes are predefined before the plotting calls.

I guess my questions are the following

  1. Should one set axis labels and title within a plot recipe?
  2. If yes, what is the correct way to do so?
@jkrumbiegel
Copy link
Member

Makie currently doesn't really have that option. Recipes are for plot objects which live inside Scenes or other plot objects and they therefore don't have the ability to specify axis metadata. Plots.jl recipes on the other hand can describe a whole figure which is where the expectation comes from I guess.

Makie has a SpecAPI which works for this use case in principle, but it's experimental and might be changed at any time so I wouldn't build functionality on top of that currently.

I think the simplest way currently is still to write normal functions that create the whole plot, or optionally plot the axis into a larger figure if a GridPosition or GridSubposition is passed as first arg.

We have internally spent quite a while already discussing this problem but haven't converged on a solution so far, there are many pros and cons to different possible solutions.

@irregular-rhomboid
Copy link
Author

Thanks for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants