Candlestick chart does not show with plotly

Jonathan Roy :

Probably something really simple.

I use an example to plot a Candlestick chart using plotly, but the plot never show up!?

This is the code from 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()

I'm using last updated python and spyder4 on anaconda. I usually use matplotlib without problem.

sentence :

It is an issue already considered in the 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'])])

plot(fig)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=336838&siteId=1