9 comments

[ 2.3 ms ] story [ 34.0 ms ] thread
I don't use R, but I think that the Vega declarative visualization language is also nice: https://vega.github.io

Could someone familiar with more than one of these compare Wilkinson's work with Wickham's and with Vega/Vega Lite?

R is more powerful, although Vega (+vega-lite) has its own advantages, like interactivity.

Vega being JSON has good and bad parts. It's good as it gives Python ecosystem something better (Altair) than matplotlib.

Bad part is that its agnostic design makes it tricky to do the math in Vega since it cannot depend on the host language (Python for Altair). It has to develop its own DSL (implemented in JS) to fill this gap. Sometimes it's very cumbersome and limiting.

IMO, having stat capability in the middle of the visualization pipeline is one of the breakthrough invention of Wilkinson's original work (GG). Wickham/ggplot2 took it seriously and built the DSL in R. But Vega didn't (relatively speaking). That design decision was probably inevitable, but it still makes Vega less powerful than ggplot2, in terms of the expressiveness.

Besides these philosophical difference, ggplot2 is very mature and robust, while Vega/Altair still has rough edges and fails on complex charting attempts from time to time.

So Vega trades off expressiveness for interactivity, interesting perspective. But, I think this only applies when manually writing the Vega (Lite) JSON: for me an important advantage of the spec being mere JSON is that it's easy to generate visualizations from another language. This approach again limits the interactivity, but only as much as you choose to - the more you generate and pre-compute, the less interactivity is possible.

(Don't know why you're down-voted.)

I don’t agree with the interactively part. Plotly library for R can read a ggplot grammar and display an interactive graph.
Immensely powerful, especially in concert with tidy data [0]. It's really remarkable how having a 'language' for the relationship between concepts can allow for so much flexibility.

As a python user, I use the plotnine[1] implementation religiously.

[0]. https://vita.had.co.nz/papers/tidy-data.pdf

[1]. https://plotnine.readthedocs.io/en/stable/

How mature is plotnine? I always had the impression it was more of an experiment on how things could be done than an actual alternative?

I too prefer the code examples I’ve seen of theirs to any other Python framework

Could someone who is familiar with multiple of these compare Wilkinson's work to Wickham's and Vega/Vega-Lite?
The latest release (v0.12) of the Seaborn plotting library in python now also has a similar API.

http://seaborn.pydata.org/tutorial/objects_interface.html

Very cool. Thx for sharing that. I heard this was coming, but I didn't know the new interface had already shipped!

For anyone interested, check out this notebook that shows some example plots presented in Seaborn's main interface and equivalent expression in the new objects interface: https://mybinder.org/v2/gh/minireference/noBSstatsnotebooks/...

I wasn't able to do an equivalent of `regplot` with the confidence interval or a `boxplot`... The other stuff works as expected.