Created
January 10, 2018 12:59
-
-
Save otbbdeploy/38ac65501c02f2a94167a5f1a27e843c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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