Live data from Hacker News

Altair – A declarative statistical visualization library for Python

github.com

21–30 of 45 posts

Re: Altair – A declarative statistical visualization library for Python

#21
post #20
post #19

Python's ploting problem is not imperative vs declarative. The main ugliness is basically "* * kwargs" every where. Every time it force you look at document to just find name of parameter you are looking for. Another common problem is Configs pass as string rather than enum.

are you arguing against keyword arguments in general, or against def foo(a, b, **kwargs): """ Refer to `bar` for the full list of allowed kwargs. """ ... i don't mind the former, but the latter always feels annoying. iirc matplotlib severely suffers from this

Latter. Named arguments (eg foo(a=1) ) are very helpful

Re: Altair – A declarative statistical visualization library for Python

#24

I've always hated matplotlib, even though it gets the job done. The graphs are ugly by default, and the API would be unusable if it weren't for StackOverflow. Maybe I just need to sit down and learn it really well. Anyway, this seems cool.

Isn't it amazing how truly bad matplotlib is?

And it gets worse because it gets new APIs with almost identical names to the previous ones, without a proper guide for when to chose which API.

And yes it's just so ugly by default.

Re: Altair – A declarative statistical visualization library for Python

#25
post #9

Earlier quoted context omitted.

Altair does have interactive legends actually. But dash is great for more complicated interactions and layouts. Panel, streamlit, and voila are also all potentially useful. https://altair-viz.github.io/gallery/interactive_legend.html https://altair-viz.github.io/user_guide/interactions.html#se...

I stand corrected, I may have to revisit Altair. Some of those other options look pretty compelling too I think it's definitely time for something to replace Matplotlib as the go-to for python plotting.

While I agree with you that matplotlib should be replaced , I see a problem in that almost all these new plotting libraries are focused on plotting statistical type data. While this is obviously a big thing at the moment, more traditional type graphs are often not well catered for by these libraries. For example I work in signal processing and would like good looking line and 3d graphs with easy layout of multiple plots... Matplotlib despite its shortcomings is still the best tool for this.

Re: Altair – A declarative statistical visualization library for Python

#27
post #9

Earlier quoted context omitted.

I've seen this done by making a fake legend out of a bar chart. As far as I know, there's no way to make an interactive legend in Altair. Personally I would look into plotly / dash for something with interactivity.

Altair does have interactive legends actually. But dash is great for more complicated interactions and layouts. Panel, streamlit, and voila are also all potentially useful. https://altair-viz.github.io/gallery/interactive_legend.html https://altair-viz.github.io/user_guide/interactions.html#se...

I think they added this in v4 within the last year. Altair is developing really quickly, and I like that. JVP has been really responsive and it’s amazing how quickly the project is adding features.

Re: Altair – A declarative statistical visualization library for Python

#28
I’ve been trying to find a “tableau to d3” product that just spits out html+css+JavaScript that can run anywhere.

Altair isn’t quite that, but it’s the closest I’ve seen. I wish python had ggplot2 with its html widgets, but this will do.

I’ve been really impressed with the browser compatibility in that I’ve yet to find a bug despite lots of weird mobile users. That and the team adds functionality quickly so almost as soon as I’m annoyed at not ability to add captions, it’s made available.

Re: Altair – A declarative statistical visualization library for Python

#29

I've always hated matplotlib, even though it gets the job done. The graphs are ugly by default, and the API would be unusable if it weren't for StackOverflow. Maybe I just need to sit down and learn it really well. Anyway, this seems cool.

> even though it gets the job done

How is this an addendum, rather than the main point? I will always take a flexible library that allows me to "get the job done" over a declarative framework that will do something similar to—but not exactly—what I need.

Re: Altair – A declarative statistical visualization library for Python

#30

FYI - Altair is available on Google Colab notebooks without any hacks or modification. https://stackoverflow.com/a/56081568/112050

Yes, makes sense. Jake VanderPlas (who is the author of the post that you linked to) is the main developer of altair and currently works at Google on Google Colab. He also has a good introductory book on Python for data science and his conference talks have a very nice style to them - the guy is just a great teacher.
Post reply on HN