Live data from Hacker News

Using Altair for most of my visualization in Python

fernandoi.cl

21–30 of 75 posts

Re: Using Altair for most of my visualization in Python

#23
post #11
post #10

Earlier quoted context omitted.

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.

Just in case, you can plot datasets larger than 5000. A quick fix is using "alt.data_transformers.enable('json')"

Re: Using Altair for most of my visualization in Python

#26

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,…

Altair builds on Vega-Lite but if you cannot do something in Vega-Lite, you can do it in Vega.

Performance is a huge concern for us and we are working on some improvements in that area. We will first focus on pushing computation and aggregation down into the Python kernel.

Re: Using Altair for most of my visualization in Python

#27
post #3

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

This is something we are painfully aware of and have started to work on. For a start, see Jake's work on https://pypi.org/project/altair-data-server/.

Re: Using Altair for most of my visualization in Python

#28
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.

Yes, you can save an Altair chart as an HTML page. See https://altair-viz.github.io/user_guide/saving_charts.html#h.... You can also just get the Vega-Lite JSON form Altair and embed it in a web page with Vega-Embed.
Post reply on HN