如何解决绘图对象在DataBrick中显示为空白
我有一个应该正确显示的绘图对象,但是由于某种原因,它仅在DataBricks中显示为空白。对象类型为:
4 TOPZ John Truck Pink
6 APOL Emily Truck Pink
我尝试了以下方法来显示该图:
plotly.graph_objs._figure.Figure
我能想到的所有可能的解决方案都会导致相同的结果。谢谢! 顺便说一下...使用Plotly 4.9版
解决方法
尝试使用plot
中的plotly.offline
方法。以下内容来自DataBricks documentation,但是Jupyter笔记本电脑存在类似的问题,除非您使用plotly.offline
,否则Plotly graph_object Figure将不会呈现。
from plotly.offline import plot
import plotly.graph_objects as go
# Instead of simply calling plot(...),store your plot as a variable and pass it to displayHTML().
# Make sure to specify output_type='div' as a keyword argument.
# (Note that if you call displayHTML() multiple times in the same cell,only the last will take effect.)
p = plot(
[ ## define your go.Figure here ##
],output_type='div'
)
displayHTML(p)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。