Wrong dates in the index plotly with a second graph I did not ask for
Question:
I am trying to plot some graphs with plotly and, after several times having the wrong graph, i backed to the basics and tried to plot an example from the plotly web, but the same error appears:
My dates are not dates, but an extremely high number (10^18 order) and I get a second small graph that noone asked for.
import plotly.plotly as py
import plotly.graph_objs as go
import pandas_datareader as web
from datetime import datetime
import fix_yahoo_finance as yf
yf.pdr_override()
df = web.DataReader("aapl", 'robinhood').reset_index()
trace = go.Candlestick(x=df.Date,
open=df.Open,
high=df.High,
low=df.Low,
close=df.Close)
data = [trace]
py.plot(data, filename='simple_candlestick')
I just changed the source (morningstar is down) and used the offline version instead of the live program, but the error still appeared if I used the web anyways, so It does not matter.
EDIT:
After a previous edit, the images are no longer appearing in the post, sorry for the inconveniences.
Answers:
OK, I managed to fix the date problem inserting the index with dates in an array and using that array as the x.
Also, I figured out that the second small graph only appears with the go.Candlestick representation (since it does not appear with figure_factory or go.Scatter hehe).
Thanks 🙂
I am trying to plot some graphs with plotly and, after several times having the wrong graph, i backed to the basics and tried to plot an example from the plotly web, but the same error appears:
My dates are not dates, but an extremely high number (10^18 order) and I get a second small graph that noone asked for.
import plotly.plotly as py
import plotly.graph_objs as go
import pandas_datareader as web
from datetime import datetime
import fix_yahoo_finance as yf
yf.pdr_override()
df = web.DataReader("aapl", 'robinhood').reset_index()
trace = go.Candlestick(x=df.Date,
open=df.Open,
high=df.High,
low=df.Low,
close=df.Close)
data = [trace]
py.plot(data, filename='simple_candlestick')
I just changed the source (morningstar is down) and used the offline version instead of the live program, but the error still appeared if I used the web anyways, so It does not matter.
EDIT:
After a previous edit, the images are no longer appearing in the post, sorry for the inconveniences.
OK, I managed to fix the date problem inserting the index with dates in an array and using that array as the x.
Also, I figured out that the second small graph only appears with the go.Candlestick representation (since it does not appear with figure_factory or go.Scatter hehe).
Thanks 🙂