Plotly in Python and R Notebooks

Plotly is an interactive graphing library. Databricks supports Plotly 2.0.7. To use Plotly, install the Plotly PyPI package and attach it to your cluster.


Inside Databricks notebooks we recommend using Plotly Offline. Plotly Offline may not perform well when handling large datasets. If you notice performance issues, you should reduce the size of your dataset.

Plotly in R notebooks

The Plotly R package relies on htmlwidgets for R. For information on how to install htmlwidgets in Databricks, see htmlwidgets in R Notebooks.

Plotly in Python notebooks

To display a Plotly plot in Databricks:

  1. Specify output_type='div' as an argument to the Plotly plot() function.
  2. Pass the output of the plot() function to Databricks displayHTML() function.

See the notebook for an example.

Plotly Python notebook

This notebook is too large to display inline. Get notebook link.