3

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
  • 8,213
  • 4
  • 31
  • 40
Jonathan Roy
  • 405
  • 1
  • 6
  • 18

1 Answers1

3

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'])])

iplot(fig)
Oleg Melnikov
  • 3,080
  • 3
  • 34
  • 65
sentence
  • 8,213
  • 4
  • 31
  • 40