Altair RenderersΒΆ
In order to turn your altair chart from the JSON structure output by Altair into a rendered visualization requires a front-end that knows how to interpret Vega and Vega-Lite specifications. To enable a particular renderer, you can use:
import altair as alt
alt.renderers.enable(renderer_name)
Altair ships with the following renderers:
- JupyterLab
JupyterLab works with the default renderer, and requires no additional enable step. To switch back to it after another renderer has been enabled, use:
alt.renderers.enable('jupyterlab') # Note: identical to enable('default')
for more details on version and system requireements, see Displaying in JupyterLab.
- nteract
nteract works with the default renderer and requires no additional enable step. To switch back to it after another renderer has been enabled, use:
alt.renderers.enable('nteract') # Note: identical to enable('default')
for more details on version and system requirements, see Displaying in nteract.
- Jupyter Notebook
for the classic Jupyter Notebook (not JupyterLab), you must switch to the
notebook
renderer:alt.renderers.enable('notebook')
Note that this requires the vega package; see Displaying in the Jupyter Notebook.
- Google Colab
Colab requires use of the
colab
renderer, which will be enabled by default when Altair is imported. To switch back to it after another renderer has been enabled, use:alt.renderers.enable('colab')
For more information, see Displaying in Colab.