Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
107 lines (95 loc) · 4.84 KB

File metadata and controls

107 lines (95 loc) · 4.84 KB
title Altair: Interactive Statistical Visualizations for Python
tags
Python
visualization
statistics
Jupyter
authors
name orcid affiliation
Jacob VanderPlas
0000-0002-9623-3401
1
name orcid affiliation
Brian E. Granger
0000-0002-5223-6168
2
name orcid affiliation
Jeffrey Heer
0000-0002-6175-1655
1
name orcid affiliation
Dominik Moritz
0000-0002-3110-1053
1
name orcid affiliation
Kanit Wongsuphasawat
0000-0001-7231-279X
1
name orcid affiliation
Arvind Satyanarayan
0000-0001-5564-635X
3
name orcid affiliation
Eitan Lees
0000-0003-0988-6015
4
name orcid affiliation
Ilia Timofeev
0000-0003-1795-943X
5
name orcid affiliation
Ben Welsh
0000-0002-5200-7269
6
name orcid affiliation
Scott Sievert
0000-0002-4275-3452
7
affiliations
name index
University of Washington
1
name index
California Polytechnic State University, San Luis Obispo
2
name index
MIT CSAIL
3
name index
Florida State University
4
name index
TTS Consulting
5
name index
Los Angeles Times Data Desk
6
name index
University of Wisconsin--Madison
7
date 07 August 2018
bibliography paper.bib

Summary

Altair is a declarative statistical visualization library for Python. Statistical visualization is a constrained subset of data visualization focused on the creation of visualizations that are helpful in statistical modeling. The constrained model of statistical visualization is usually expressed in terms of a visualization grammar [@2005-grammar] that specifies how input data is transformed and mapped to visual properties (position, color, size, etc.).

Altair is based on the Vega-Lite visualization grammar [@2017-vega-lite], which allows a wide range of statistical visualizations to be expressed using a small number of grammar primitives. Vega-Lite implements a view composition algebra in conjunction with a novel grammar of interactions that allow users to specify interactive charts in a few lines of code. Vega-Lite is declarative; visualizations are specified using JSON data that follows the Vega-Lite JSON schema. As a Python library, Altair provides an API oriented towards scientists and data scientists doing exploratory data analysis [@1977-exploratory]. Altair's Python API emits Vega-Lite JSON data, which is then rendered in a user-interface such as the Jupyter Notebook, JupyterLab, or nteract using the Vega-Lite JavaScript library. Vega-Lite JSON is compiled to a full Vega specification [@2016-reactive-vega-architecture], which is then parsed and executed using a reactive runtime that internally makes use of D3.js [@2011-d3].

The declarative nature of the Vega-Lite visualization grammar [@2005-grammar; @2017-vega-lite], and its encoding in a formal JSON schema, provide Altair with a number of benefits. First, much of the Altair Python code and tests are generated from the Vega-Lite JSON schema, ensuring strict conformance with the Vega-Lite specification. Second, the JSON data produced by Altair and consumed by Vega-Lite provides a natural serialization and file format for statistical visualizations. This is leveraged by JupyterLab, which provides built-in rendering of these files. Third, the JSON data provides a clean integration point for non-programming based visualization user-interfaces such as Voyager [@2016-voyager;@2017-voyager2].

In addition to static documentation, Altair includes a set of Jupyter Notebooks with examples and an interactive tutorial. These notebooks can be read by anyone with only a web-browser through binder.

-Seattle Weather Interactive Visualization

The example above is an interactive Altair visualization of the weather in Seattle. The plot on the left shows the initial state: a scatterplot showing the temperature and dominant weather type between January and December, and a bar chart showing the counts grouped by weather type. The plot in the middle shows a brush that the user has drawn to focus on the summers; which are dominantly sunny. In the last plot on the right, the user has clicked on the a bar to filter the scatterplot.

These interactions are achieved through two selections: an interval selection on the scatterplot and a multi selection on the bar chart. The selections drive filters in the other plot. The code for this and other examples is in the Altair gallery.

Acknowledgements

We thank the many contributors that created examples, wrote documentation, and reported bugs. You can find an up-to-date list of contributors on GitHub.

References