altair
altair copied to clipboard
Create a section for distribution and/or statistical plots in the gallery
Currently there is a separate section for histograms. I think we should expand this to contain all distribution plots, including densities, violins, cumulative ones, etc, and rename the section to "distributions".
There are also some other "statistical charts" that I think would be useful to lift out of their respective sections. These relate to visualizing uncertainty/errors and trends in data. The motivation for lifting these out of their respective "mark" section is that the mark used here is often secondary to something else in the spec, e.g. a transform and someone looking for how to visualize a confidence interval would likely benefit from seeing this for both lines and points in the same section about uncertainty rather than spread out over different marks.
Below I have indicated what I think should be added to these two sections and where those charts are currently located.
Distributions
OTHER
- binned heat
- violin
- ridge
- box
- faceted scatter?
SCATTER
- strip?
- scatter with marginal dashes?
- qqplot
- binned scatter
AREA
- Cumulative count
- Faceted density
- stacked density
Uncertainties and trends
SCATTER
- loess
- polynomial regression
- points with error bars
LINE
- confidence interval
This is a follow up on https://github.com/altair-viz/altair/issues/2661 and cc @binste in case you have any thoughts on this
I like it! I have found myself in the past jumping back and forth between different sections in the gallery to compare for example distribution charts.
I saw that the "stripplot" example still uses the "old" column syntax where as the newly added jitter chart uses xoffset. In my understanding, a jitter chart is a strip plot with added jitter and sometimes also just called a strip plot. See https://datavizproject.com/data-type/strip-plot/ and https://datavizproject.com/data-type/jitter-plot/ Could these examples maybe be combined into one called "Strip Plot" and then it has two plots in it, one with jitter and one without? Or split it into two examples "Strip Plot" and "Strip Plot with Jitter" but using the same syntax?
Happy to work on this in the next 2 weeks if you agree, creating the new sections and potentially harmonising some plots.
Great! Thanks for offering to work on this, that would be very welcome. I think these changes will only make it easier to navigate the gallery, and if anyone disagrees they can always chime in here, so please go ahead and get started when you have time. Note that when you build the example pages locally for testing, it will look quite different from the current online docs, since we had a style revamp to be launched online later (it will look like this https://joelostblom.github.io/altair-docs/gallery/index.html). Let me know if there is anything you think should be clarified regarding the instructions for contributing to the docs and setting things up.
Regarding your comment on the stripplots, there is already an example of one without jitter in the "Simple plots" sections (which I think can stay there), so maybe you can just change the current stripplot implementation to use the offset encoding instead of the transform and call it "Stripplot with jitter" (and flip x and y so that the labels are easier to read)? I don't know if there is some some scenario where the old transform would be more helpful, but if you can think of one feel free to make a separate example for that (otherwise I believe it is fine to remove this chart, and I don't see an equivalent in the vega library either although I personally find it interesting).
Closed in #2706