5

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/

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

do you know if there has been an update on this? I checked the link and the item seems close now but I didn't get exactly what the solution was...
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.