4 ms·
As a related tool, there is Altair (https://altair-viz.github.io/ https://altair-viz.github.io/), which also implements the Grammar of Graphics as well as a Gra
by domoritz 6y ago
As a related tool, there is Altair (https://altair-viz.github.io/ https://altair-viz.github.io/), which also implements the Grammar of Graphics as well as a Grammar of Interaction.
- vladsanchez 6y agoYou beat me here! I was surprised that I didn't find "Altair" in the source article. Thanks for posting.
- fn-mote 6y agoWhat does this mean "implements the Grammar of Graphics"? Plotly really does look like ggplot, but Altair doesn't look nearly as friendly: alt.Chart(source).mark_bar().encode( alt.X("IMDB_Rating:Q", bin=True), y='count()', ) I guess I can see how it does the same thing, but the ergonomics don't really appear to be in the same league.
- domoritz 6y agoTake a look at the underlying Vega-Lite library (https://vega.github.io/vega-lite/ https://vega.github.io/vega-lite/) and the paper that introduces the grammar of interactions (https://idl.cs.washington.edu/papers/vega-lite/ https://idl.cs.washington.edu/papers/vega-lite/) for some insights into the design. What specifically do you find unergonomic about the design of Altair?
- animal_spirits 6y agoAltair is a cool library and I hope it continues to improve. I like using it, but the main problem I've had with Altair is the size of the plots. Unless you save the plot as an image, the plot is rendered as a Vega-Lite spec JSON object. The JSON spec stores the entire dataset, so it limits you to using 5,000 data points. Otherwise you'll have this insanely large JSON object representing the plot. There are work-arounds like using a data server however.
- prepend 6y agoYou can disable that if you need to and “insanely” large json objects are still just hundreds of megs or maybe a few gigs, still reasonable. But I’ve also been able to just preprocess some of the aggregation and calculation before the visualization and that’s worked out ok. I’ve used it over plotly a few times because there’s no offline/online issue with plotly, and I think the Altair method of saving interactive javascript versions more straightforward than plotly.
- xkcd-sucks 6y ago> the plot is rendered as a Vega-Lite spec JSON object. The JSON spec stores the entire dataset, so it limits you to using 5,000 data points Use "named datasets", specify data via URL, etc. Do not ever specify data inline with the spec. It might get loaded into a JSON object under the hood regardless, IDK, but it's remarkably faster and simple plots of ~100000 points will work on the average computer/vm
- wodenokoto 6y agoGrammar of Graphics is a book[1] that talks about how to talk about graphics. ggplot is an interpretation of grammar of graphics. Altair is another, separate interpretation. As far as I can understand, plotnine is an attempt at replicating ggplot. [1] https://www.springer.com/gp/book/9780387245447 https://www.springer.com/gp/book/9780387245447