Live data from Hacker News

Using Altair for most of my visualization in Python

fernandoi.cl

11–20 of 75 posts

Re: Using Altair for most of my visualization in Python

#11
post #10
post #3

Altair is incredible until you realise your plots are bigger than your data. It's annoying, but overall still very good.

Can you speak more about this? Are you saying that Altair's speed scales poorly with dataset size?

It throws an error if you try to plot more than 5000 datapoints by default, internally altair produces a JSON representation (vega-lite) that is larger than the data you plot (because it contains the data you plot, plus formatting information). If you save this output, for example in an ipython notebook, it gets phat pretty quickly.

Altair is still great though, but this issue makes it occasionally annoying.

Re: Using Altair for most of my visualization in Python

#15
I'm partial to plotnine (https://github.com/has2k1/plotnine). It is an implementation of grammar of graphics in python (like ggplot2).

It provides a stateless layer like interface which feels intuitive, and avoids bugs due to global state.

But, it is built on top of matplotlib. So, if plotnine cannot do something, you can go back to the matplotlib way of doing things and take advantage of the large number of blogs, example, tutorials, and stackoverflow answers.

Performance wise, it can handle more data than altair. But less than matplotlib, if you use the built in data manipulation features.

Re: Using Altair for most of my visualization in Python

#16

Pretty cool. > Sadly, in Python, we do not have a ggplot2. I've got to ask, though: why is that the case?

I'm not sure it is. I'm more of an R guy, but when I do use python I use plotnine[1], which is very ggplot2-like.

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

Re: Using Altair for most of my visualization in Python

#19
post #17

How is Altair on 3D data? I see no examples of this. Matplotlib is decent here (apart from all the same disadvantages the author lays out), but the default options look kinda fugly.

In the article it says Altair does not do 3D plotting, if that was your question.

Re: Using Altair for most of my visualization in Python

#20
post #14

I'm looking for an interactive visualization tool that I could have site visitors access via a github blog page. Does Altair manage client-side processing? I'm still pretty new in the search but like Altair's adoption of Vega-lite.

Plotly plots saved as html?
Post reply on HN