1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
.. _overview:
Overview
========
Vega-Altair is a declarative statistical visualization library for Python, based on
Vega_ and Vega-Lite_.
It offers a powerful and concise grammar that enables you to quickly build
a wide range of statistical visualizations. Here is an example of using the
API to visualize a dataset with
an interactive scatter plot:
.. altair-plot::
# import altair with an abbreviated alias
import altair as alt
# load a sample dataset as a pandas DataFrame
from vega_datasets import data
cars = data.cars()
# make the chart
alt.Chart(cars).mark_point().encode(
x='Horsepower',
y='Miles_per_Gallon',
color='Origin',
).interactive()
The key idea is that you are declaring links between *data columns* and *visual encoding
channels*, such as the x-axis, y-axis and color. The rest of the plot details are
handled automatically. Building on this declarative system, a surprising range
of plots, from simple to sophisticated, can be created using a
concise grammar.
The project is named after the `brightest star <https://en.wikipedia.org/wiki/Altair>`_
in the constellation Aquila. From Earth's sky Altair appears close to Vega, the star from which our parent project drew its name.
This documentation serves as the main reference for learning about Altair. Additional learning material and tutorials can be found in the :ref:`learning-resources` section. It can also be helpful to browse the `Vega-Lite documentation <https://vega.github.io/vega-lite/docs/>`_.
.. _Vega: http://vega.github.io/vega
.. _Vega-Lite: http://vega.github.io/vega-lite
.. toctree::
:maxdepth: 1
:caption: Getting Started
:hidden:
self
installation
starting
getting_help
project_philosophy
|