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

Allow special aesthetic for relative positioning #95

Open
OriolAbril opened this issue Oct 17, 2024 · 1 comment
Open

Allow special aesthetic for relative positioning #95

OriolAbril opened this issue Oct 17, 2024 · 1 comment

Comments

@OriolAbril
Copy link
Member

Not very clear on what we want this to be. I think a good starting point would be allowing a yrelative (or some better name) in plot_dist which is then converted into an actual y value multiplying by the maximium of the kde/hist/ecdf inside plot_dist.

Idea of steps involved:

  1. User provides yrelative values
  2. aesthetics are generated for yrelative which can be retrived as dataset
  3. yrelative dataset is multiplied by density.max(some_dims) -> xarray handles all aligment and broadcasting
  4. y aesthetic is created and yrelative deleted or yrelative gets its values overwritten and the aesthetic renamed (whatever we find easier to implement)
  5. Plotting backends only see y aesthetic

This might not 100% work with the exact relative ratios we'd want but I think it will generally be good enough and probably much easier than attempting to handle relative spacing across backends. But it is also true I have literally no idea how to use relative units in bokeh nor plotly, so it is always possible that is easier than the steps above.

@aloctavodia
Copy link
Contributor

I agree in general, but just providing y may be enough, as we then scale them by max density. At least for plots like plot_dist, it makes sense to always think of y in relative terms.

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

No branches or pull requests

2 participants