Python Plotly未在google collaboratory笔记本中正确显示图形标题

Python Plotly未在google collaboratory笔记本中正确显示图形标题,python,plotly,data-visualization,Python,Plotly,Data Visualization,我在colab中使用了plotly,但我尝试了很多让它正确地显示标题 scatt_plot=go.Scatter(x=df['Date'],y=df['Total Income'], mode='lines', 线条=dict(颜色='rgb(200,50,50'),宽度=1.5), text=“收入”, hoverinfo=“text+x+y”, connectgaps=True, name=“收入”, textfont=dict(family='Arial',size=12)) 布局=开始布

我在colab中使用了plotly,但我尝试了很多让它正确地显示标题

scatt_plot=go.Scatter(x=df['Date'],y=df['Total Income'],
mode='lines',
线条=dict(颜色='rgb(200,50,50'),宽度=1.5),
text=“收入”,
hoverinfo=“text+x+y”,
connectgaps=True,
name=“收入”,
textfont=dict(family='Arial',size=12))
布局=开始布局(title=“三年收入”)
图=开始图(数据=[散点图],布局=布局)
py.iplot(图)
本例中数字的标题应为“3年内收入”,但它生成[对象]作为数字标题。这段代码在本地jupyter中运行良好,但问题只出现在colab中

我使用这段代码在colab中浏览绘图

导入IPython
def configure_plotly_browser_state():
进口伊皮顿
显示(IPython.core.display.HTML(“”)
requirejs.config({
路径:{
base:“/static/base”,
绘声绘色地说:'https://cdn.plot.ly/plotly-1.5.1.min.js?noext',
},
});
'''))
IPython.get\u IPython().events.register('pre\u run\u cell',configure\u plotly\u browser\u state)
py.init_笔记本_模式(connected=False)