Re:Effectively Using Matplotlib (2017)
by jackbrookes on Saturday November 16, 2019 @05:08AM
(#21551909)
What is the state of the art in Python data visualisation compared to ggplot2 in R? Over the last few years I have gone exclusively with ggplot2 because it seems so intuitive and customisable.
[ Parent
| on HN ]
Can I plug my Veusz GUI plotting application? It's written in Python, so it's also a Python plotting library. It's more a object-orientated library than matplotlib, so plots are built out of widgets.
Re:Effectively Using Matplotlib (2017)
by claytonjy on Saturday November 16, 2019 @05:22AM
(#21551945)
Altair is getting pretty good. It's a bit like ggplot in that it's declarative, though I wouldn't suggest dropping R for this any time soon.
Re:Effectively Using Matplotlib (2017)
by koningrobot on Saturday November 16, 2019 @05:51AM
(#21552002)
Another option is to use plotnine, which is intended to be a ggplot2 clone. It uses matplotlib under the hood, so if something isn't right you can tweak it. That was the main drawback I found with Altair: your declarative code is almost literally dumped to a json file and then rendered by a process external to Python, so good luck tweaking your plot.
I think there are some pretty good arguments for why Altair (which is just Python bindings for Vega Lite) should be people's first choice. I've written about this here https://medium.com/@robin.linacre/why-im-backing-vega-lite-a....
In my mind, ggplot2 is actually more comparable to matplotlib in that it's more expressive, but less intuitive. It's interesting that the 'successor' to ggplot2,ggvis (which is on ice) , used Vega as a backend.
Re:Effectively Using Matplotlib (2017)
by j88439h84 on Saturday November 16, 2019 @06:05AM
(#21552040)
Plotnine is a verbatim port of ggplot2. There are other ports but plotnine is the good one.
bokeh (https://github.com/bokeh/bokeh) and seaborn (http://seaborn.pydata.org) are popular