added callouts to age group record graph
This commit is contained in:
@@ -1073,6 +1073,8 @@ def interactive_agegroup_plot(df):
|
||||
|
||||
age = df['age']
|
||||
power = df['power']
|
||||
name = df['name']
|
||||
season = df['season']
|
||||
|
||||
poly_coefficients = np.polyfit(age,power,6)
|
||||
|
||||
@@ -1084,17 +1086,29 @@ def interactive_agegroup_plot(df):
|
||||
age = age,
|
||||
power = power,
|
||||
age2 = age2,
|
||||
poly_vals = poly_vals
|
||||
poly_vals = poly_vals,
|
||||
season = season,
|
||||
name=name,
|
||||
)
|
||||
)
|
||||
|
||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||
|
||||
plot = Figure(plot_width=900)
|
||||
plot = Figure(tools=TOOLS,plot_width=900)
|
||||
plot.circle('age','power',source=source,fill_color='red',size=15,
|
||||
legend='2k Power')
|
||||
plot.line(age2,poly_vals)
|
||||
plot.xaxis.axis_label = "Age"
|
||||
plot.yaxis.axis_label = "Concept2 2k power"
|
||||
|
||||
hover = plot.select(dict(type=HoverTool))
|
||||
|
||||
hover.tooltips = OrderedDict([
|
||||
('Name ','@name'),
|
||||
('Season ','@season'),
|
||||
])
|
||||
|
||||
hover.mode = 'mouse'
|
||||
|
||||
script,div = components(plot)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user