Create an interactive scatter plot from a data file where clicking a point highlights it in a linked bar chart.
Export a polished data visualization as standalone HTML to share with stakeholders who have no Python setup.
Build a multi-view dashboard in a Jupyter notebook where brushing one chart filters all the others.
Vega-Altair is a Python library for creating charts and graphs from data. It takes a declarative approach, meaning you describe what your visualization should look like (which columns map to which axes, how to color points, what chart type to use) rather than writing code that draws each element step by step. This makes it possible to produce complex charts with only a few lines of code. The library is built on top of Vega-Lite, an open specification for defining visualizations as JSON objects. When you write an Altair chart in Python, you are constructing that JSON specification through a Python API. The resulting chart can be displayed in JupyterLab, Jupyter Notebook, Visual Studio Code, or GitHub, and can be exported as PNG, SVG, standalone HTML, or a JSON file. A key feature inherited from Vega-Lite is support for interaction. You can define selections (like clicking or brushing a region of a scatter plot) and link them to other charts so that filtering one view automatically updates another. The README demonstrates this with an example where brushing a scatter plot of car data filters a bar chart showing the count of cars by country of origin. Installation is through pip or conda. The library is available on PyPI as the package named altair. Documentation, gallery examples, and interactive tutorial notebooks are at altair-viz.github.io. The notebooks can also be run directly in the browser through Binder or Google Colab without any local installation. Vega-Altair was originally developed by researchers at the University of Washington Interactive Data Lab and has been published as an academic paper in the Journal of Open Source Software. It is not affiliated with Altair Engineering, a separate company with a similar name.
← vega on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.