当我运行以下代码时:
init_notebook_mode(connected=True)
from plotly.offline import plot
import plotly.graph_objects as go
colors = ['gold', 'mediumturquoise', 'darkorange', 'lightgreen']
fig = go.Figure(data=[go.Pie(labels=['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen'],
values=[4500,2500,1053,500])])
fig.update_traces(hoverinfo='label+percent', textinfo='value', textfont_size=20,
marker=dict(colors=colors, line=dict(color='#000000', width=2)))
plot(fig)
该图显示了,但是它在新选项卡中显示。我希望该图在同一笔记本(内联)中打开。我想念什么吗?