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.
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.
9 comments
[ 2.3 ms ] story [ 34.0 ms ] threadCould someone familiar with more than one of these compare Wilkinson's work with Wickham's and with Vega/Vega Lite?
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.
(Don't know why you're down-voted.)
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/
I too prefer the code examples I’ve seen of theirs to any other Python framework
http://seaborn.pydata.org/tutorial/objects_interface.html
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.