Reputation: 1153
I am using python3. I have a price quote series of 1 minute frequency. The quote is only available in trading hours. I tried to plot it using plotly, but there are gaps in non trading hours and weekends. How can I make this plot consecutive?
My code is like
ifBasisPlot=go.Scatter( x=ifBasis.date, y=ifBasis.basis, line=go.Line(width=1,color='blue'), name='basis' )
data = go.Data([ifBasisPlot])
ifBasisPlot_url = py.plot(data, filename='ifBasisPlot', auto_open=False,)
the plot and the data is here: https://plot.ly/~shuaihou96/14/if/
Upvotes: 5
Views: 2679
Reputation: 4118
You can try to change this code
ifBasisPlot=go.Scatter( x=ifBasis.date, y=ifBasis.basis, line=go.Line(width=1,color='blue'), name='basis' )
into
ifBasisPlot=go.Scatter( x=range(len(ifBasis.date)), y=ifBasis.basis, line=go.Line(width=1,color='blue'), name='basis' )
Upvotes: 0