Altair: Declarative Visualization in Python
altair-viz.github.io
altair-viz.github.io
Vega / Vega-lite are doing something cool, namely bringing the grammar of graphics to the web. By extension, Altair may not be the only plotting library you need in Python, but it's rapidly becoming the one I'd look to first.
Bokeh's strength (for me) is when I need to heavily customize a visual to an extreme. I know of some who use it for streaming data - etc which cannot be done in altair.
Additionally you would only want to use Altair on medium sized data. But Bokeh in combination with Holoviews and Datashader can render incredible amounts of data (see pyviz.org)
I'm a newbie to data visualization so their extensive examples and how their organized is a way better exploratory experience for me.
Also their API seems way more sane than MatPlot. I haven't used both extensively so these are just first impressions
Matplotlib intentionally took on the API that Matlab had created, to make it easier for Matlab users to jump over to the Python ecosystem. But today, very few people are coming to Python from a Matlab background so the API just looks wonky.
To quote from their documentation [1]: "While it is easy to quickly generate plots with the matplotlib.pyplot module, we recommend using the object-oriented approach for more control and customization of your plots."
I use matplotlib.pyplot for basically only two purposes, calling subplots to get figure and axis objects, or calling rc_context to set up a "with" block with certain settings (e.g. font size).
That said, I'm certainly watching where alternative plotting libraries are going. I've used bqplot a bit, but only played around with others so far.
[1] https://matplotlib.org/api/pyplot_summary.html#the-object-or...
I'm curious whether anyone else has had similar frustrations? I wonder what enhancements might make practical use of Altair for those use cases easier.
If you have specific use case that's really cumbersome in Altair/Vega-Lite, please feel free to file an issue. We're happy to help improve the tool. :)
Disclosure: I'm a co-author of Vega-Lite.
https://dsaber.com/2016/10/02/a-dramatic-tour-through-python...
At that time (Fall 2016), Altair was at v1.2. Version 1.2.1 hit a full year later. And v2.0 apparently landed just last month:
What about batch mode - in case you want to generate reports and send it by email ?
Notebooks can be shared just like any other Jupyter Notebook (charts become images unless are running the notebook). If you want something more polished, you can build a dashboard. Under the hood, Altair uses Vega-Lite so you can export your charts and embed them in a web dashboard with https://github.com/vega/vega-embed. To send charts, you can export them as images.
Following the instructions leads to an error at the from vega_datasets line.
Needed to fix by first running !pip install vega_datasets
I see there's a debate on building vega_datasets into Altair, but just wanted to offer a potential revision to the docs for that section.