Skip to content

ehansis/altair_demo

Repository files navigation

altair_demo

This is a collection of demo notebooks for plotting in Python with Altair/Vega-Lite.

Installation

To get started with Altair, follow the instructions in the Altair documentation.

If you are using Conda for managing your Python packages and environments, the following one-liner will set up a new environment altair for you and install the required packages:

conda create -n altair -c conda-forge python=3.7 altair vega_datasets jupyterlab

This uses JupyterLab. After installation you can launch a new session with

jupyter lab

If you want to programatically save svg or png versions of your graphs, you'll need to also install the selenium Python package and the chromedriver executable - see the Altair docs or ask your favourite search engine for help.

Notebooks

Please note: Interactive graphs work neither in the GitHub notebook preview nor in nbviewer. To play with the interactive graphs you'll have to clone the notebook and open it in your local JupyterLab environment. For some graphs there's also a html version saved in the output folder.

(Or does anybody know how to view notebooks with interactive graphs in a zero-installation way like nbviewer? Let me know!)

  • quickstart_example.ipynb: Example from the quickstart section of the Altair docs (to check installation worked)
  • display_examples.ipynb: Different ways of showing or saving charts (show in nbviewer)
  • interactive_examples.ipynb: Some interactive examples copied from the Altair docs (show in nbviewer)
  • talk_plots.ipynb: Example plots used in talk slides (show in nbviewer)
  • live_demo.ipynb: Cheat sheet and results for live demo (show in nbviewer)

References

Packages

Grammar-of-Graphics background

Other interesting stuff

About

Demo notebooks for Altair plotting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published