Skip to content

Instantly share code, notes, and snippets.

@otbbdeploy
Created January 10, 2018 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otbbdeploy/38ac65501c02f2a94167a5f1a27e843c to your computer and use it in GitHub Desktop.
Save otbbdeploy/38ac65501c02f2a94167a5f1a27e843c to your computer and use it in GitHub Desktop.
# Set up the color scales
bupu = cl.scales['3']['seq']['BuPu']
colorscale = cl.interp( bupu, 16 )
colorscale.reverse()
# Create the data structure needed for plotly
i=0
data = []
while i < len(test_periods):
data.append(
Scatter(
x=df['returnperiod'],
y=data_run_list[i],
name='> ' + str(test_periods[i]*100) + '% (' + str(obs_num_list[i]) + ' obs)',
marker = dict(
color = colorscale[i]
)
)
)
i = i + 1
# Create the layout needed for plotly
layout = Layout(
title='Average Return After Correction for ' + symbol + ' from ' + usingdatafrom + ' to ' + usingdatato,
yaxis=dict(title='return'),
xaxis=dict(title='days after correction')
)
# Create and plot the figure
fig = Figure(data=data, layout=layout)
iplot(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment