Live data from Hacker News

Vega-Altair: Declarative Visualization in Python

altair-viz.github.io

11–20 of 44 posts

Re: Vega-Altair: Declarative Visualization in Python

#11
post #8

Sidenote: Has Vega* a specific reference to the "Grammar of Graphics" 2005 book [1]? I used that book in research and remember praying for a real implementation. Looking into SO and an answer appeared in 2014 [2]. [1] https://link.springer.com/book/10.1007/0-387-28695-0 [2] https://stackoverflow.com/questions/4892368/implementations-...

In https://github.com/vega/vega-lite/issues/408#issuecomment-50... Leland Wilkinson himself said “having gone through a lot of these GG-inspired systems, I believe yours is the most authentic implementation. I'm using it every day. Thanks for all the great work you've done.”

Re: Vega-Altair: Declarative Visualization in Python

#13
I've found altair/vega to not 'feel' declarative as whenever I sit down and try to pass in a json config for basic scenarios... something always gets in the way. GG is composable, so this should work in theory, so I've been curious - it feels close.

We have been enjoying Perspective as a more declarative & high-performance flow. Altair/Vega is beautiful though so it was a bummer when we dropped it for a recent project.

Re: Vega-Altair: Declarative Visualization in Python

#14

I've found altair/vega to not 'feel' declarative as whenever I sit down and try to pass in a json config for basic scenarios... something always gets in the way. GG is composable, so this should work in theory, so I've been curious - it feels close. We have been enjoying Perspective as a more declarative & high-performance flow. Altair/Vega is beautiful though so it was a bummer when we dropped it for a recent projec…

If I may ask, what's Perspective - couldn't find anything on a first google search.

Re: Vega-Altair: Declarative Visualization in Python

#15

I've found altair/vega to not 'feel' declarative as whenever I sit down and try to pass in a json config for basic scenarios... something always gets in the way. GG is composable, so this should work in theory, so I've been curious - it feels close. We have been enjoying Perspective as a more declarative & high-performance flow. Altair/Vega is beautiful though so it was a bummer when we dropped it for a recent projec…

If I may ask, what's Perspective - couldn't find anything on a first google search.

Most likely https://github.com/finos/perspective

Re: Vega-Altair: Declarative Visualization in Python

#17
Like many, I was a big fan of ggplot2 from R, so coming into Python, I've always been searching for an equivalent graphical library. I used to be put off by Altair's famous

    MaxRowsError: The number of rows in your dataset is greater than the maximum allowed (5000).
but ever since the Vegafusion companion library came unto the scene, I'm back using Altair.

Overall, it's my preferred Python viz library although I do wish there was a better way for the Python library to better use introspection. After all, rather than

   alt.Chart(df).mark_line.encode(x="abc:Q")
to provide the information that abc is a quantitative variable, I'd much rather the library be able to introspect the df object, column abc to derive the data type and make the inference the column is quantitative.

That said, I'm already used to the extra syntax so still feel confident in using this library daily.

[1] https://vegafusion.io/index.html

Re: Vega-Altair: Declarative Visualization in Python

#18
post #4

Is there a plotting library that uses webgl? I am only aware of Plotly that uses webgl for some of the graphs.

We are working on GPU accelerated rendering for Vega and Altair.

Is this open? Is there a way to read more about it? Issues/pull requests?

Re: Vega-Altair: Declarative Visualization in Python

#19

Working as a data scientist, I have exclusively used Altair since I joined my company in 2021. Every one of my coworkers uses Matplotlib. Two people said something like "Oh, you're using that library that's supposed to be better and probably is, but I just don't want to relearn everything for plotting" but nobody else has even shown interest, let alone taken the plunge. If you need to learn a plotting library and you…

To save to an image in Altair, it's just chart.save("myimage.png"). This works much better since version 5 (the syntax is the same but the dependencies are less fiddly)
Post reply on HN