Why isn’t my plot displaying in the Jupyter Notebook?
官网:https://altair-viz.github.io/faq.html
The most common cause of a non-displaying plot in the Jupyter Notebook is incorrect configuration of the ipyvega jupyter extension, which is what recognizes an Altair object and automatically renders the plot with the Vega-Lite library.
If you install altair using conda
, this nbextension setup step should be taken care of automatically. If you install altair using pip
, there is an extra step to