Replies: 1 comment
-
Interesting! I know that you can add custom scales in Vega - underlying Vega-Lite, here: https://vega.github.io/vega/docs/api/extensibility/#scales note the warning at the top though Not sure if you will get to reference this scale type in Vega Lite or need to modify the Vega spec VL compiles into. I guess the axis plotting will work as normal, pointing to a new scale in the spec The Vega scale code is around here: https://github.com/vega/vega/blob/main/packages/vega-scale/src/scales/scaleBinOrdinal.js Maybe nice feature request is for custom scales in Vega Lite and then Altair - since Vega itself appears to support it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks,
I've been getting deeper into vega-lite via Altair and I wasn't able to locate any examples or documentation about creating custom axes transformations and scales beyond the bundled continuous scales.
To be specific, I wrote a library called mpl-probscale that implements probability scales in (wait for it...) matplotlib.
Short version: probability scales take a quantile plot and convert the quantiles to probabilities (and back) based on the CDF/PPF of some user-specified probability distribution (typically normal or weibull in my field).
Here's an example comparing three different probability scales and a linear scale all with the same tick locations:
(here's a link to the docs page, just scroll down a bit)
I'd love to be able to do something like this in vega-lite (and eventually Altair), but I'm getting a little lost in the internals. Can anyone point me in the right direction?
Beta Was this translation helpful? Give feedback.
All reactions