Live data from Hacker News

Using Altair for most of my visualization in Python

fernandoi.cl

31–40 of 75 posts

Re: Using Altair for most of my visualization in Python

#31
The problem with all these nice new visualization libraries for Python, is that they all (at least the shinny nice ones) fail totally short when it comes to do B&W graphics for journal publications. Things like filling patterns, line patterns etc, are mostly missing.

I still use Matplotlib and I can make it look beautiful and exactly how I want... it's just a lot more work to get the shinny bits.

Re: Using Altair for most of my visualization in Python

#32
post #8

This talk from PyCon 2019 is related and may be of interest: https://www.youtube.com/watch?v=vTingdk_pVM

His earlier talk is great too to get the lay of the land...

Jake VanderPlas The Python Visualization Landscape PyCon 2017

https://www.youtube.com/watch?v=FytuB8nFHPQ

Re: Using Altair for most of my visualization in Python

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

`bokeh` is another package that can fit this bill.

Re: Using Altair for most of my visualization in Python

#35

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

No fundamental reason. ggplot2 was released 4 years after matplotlib, and the Python ecosystem was already centered around the latter by the time it became obvious that the grammar of graphics approach was superior. Python's surging popularity in the data analysis space is also pretty recent.

But any approach to a ggplot2 equivalent either has to abandon the massive ecosystem around matplotlib, or build on top of it – and matplotlib's heavily state-based approach makes that difficult. Plotnine is attempting to do that, I hear it's pretty good.

Re: Using Altair for most of my visualization in Python

#37
post #31

The problem with all these nice new visualization libraries for Python, is that they all (at least the shinny nice ones) fail totally short when it comes to do B&W graphics for journal publications. Things like filling patterns, line patterns etc, are mostly missing. I still use Matplotlib and I can make it look beautiful and exactly how I want... it's just a lot more work to get the shinny bits.

The underlying vega library supports overriding styles for color and line properties - it may not be as difficult as you imagine to generate B&W graph outputs for print.

Re: Using Altair for most of my visualization in Python

#38
Anyone figured out how to use Altair with VSCode to plot in a separate window ? If I use matplotlib, I can use the show() method to plot in a separate window. I would love to have a similar thing for Altair. I'm fine if there's a working method in Spyder as an alternative.

Re: Using Altair for most of my visualization in Python

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

I'll dig in -- thanks! Looking for the interactivity -- surely that's not supportable in native HTML, right? Has to use JS or CSS? (I'm not a web-dev of any sort, only very superficial understanding, data scientist by day)

EDIT: Ohhhh, this looks nice!

Post reply on HN