Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python use plotly to plot time series without date gaps

Tags:

python

plotly

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/

like image 488
cone001 Avatar asked Nov 08 '22 18:11

cone001


1 Answers

I believe there is an open PR for the plotly project. link

As mentioned in the PR, we could use a tickformat x axis attribute; @etpinard had made a proof of concept chart, but that may not work if zooming is involved.

like image 68
PaulDong Avatar answered Nov 14 '22 22:11

PaulDong