烛台图表不显示 plotly

Candlestick chart does not show with plotly

可能真的很简单。

我用一个例子来使用 plotly 绘制烛台图,但该图从未显示!?

这是来自https://plot.ly/python/candlestick-charts/

的代码
import plotly.graph_objects as go

import pandas as pd
from datetime import datetime

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')

fig = go.Figure(data=[go.Candlestick(x=df['Date'],
                open=df['AAPL.Open'],
                high=df['AAPL.High'],
                low=df['AAPL.Low'],
                close=df['AAPL.Close'])])

fig.show()

我在 anaconda 上使用最后更新的 python 和 spyder4。我通常使用 matplotlib 没有问题。

这个问题已经在 plotly community:

中考虑过了
import plotly.graph_objects as go
from plotly.offline import iplot
import pandas as pd
from datetime import datetime

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')

fig = go.Figure(data=[go.Candlestick(x=df['Date'],
                open=df['AAPL.Open'],
                high=df['AAPL.High'],
                low=df['AAPL.Low'],
                close=df['AAPL.Close'])])

iplot(fig)