Plotly 是交互式绘图库。Plotly is an interactive graphing library. Azure Databricks 支持 Plotly 2.0.7。Azure Databricks supports Plotly 2.0.7. 若要使用 Plotly,请安装 Plotly PyPI 包,并将其附加到群集。To use Plotly, install the Plotly PyPI package and attach it to your cluster.


我们建议在 Azure Databricks 笔记本内部使用 Plotly OfflineInside Azure Databricks notebooks we recommend using Plotly Offline. 处理大型数据集时,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 绘图:To display a Plotly plot:

  1. output_type='div' 指定为 Plotly plot() 函数的参数。Specify output_type='div' as an argument to the Plotly plot() function.
  2. plot() 函数的输出传递到 Databricks displayHTML() 函数。Pass the output of the plot() function to Databricks displayHTML() function.

有关示例,请参阅笔记本。See the notebook for an example.

Plotly Python 笔记本Plotly Python notebook

获取笔记本Get notebook