charts age decline of 2k power per weight/sex group
This commit is contained in:
@@ -1069,6 +1069,37 @@ def interactive_otwcpchart(powerdf,promember=0):
|
||||
|
||||
return [script,div,p1,ratio,message]
|
||||
|
||||
def interactive_agegroup_plot(df):
|
||||
|
||||
age = df['agemin']
|
||||
power = df['power']
|
||||
|
||||
poly_coefficients = np.polyfit(age,power,6)
|
||||
|
||||
age2 = np.linspace(11,95)
|
||||
poly_vals = np.polyval(poly_coefficients,age2)
|
||||
|
||||
source = ColumnDataSource(
|
||||
data = dict(
|
||||
age = age,
|
||||
power = power,
|
||||
age2 = age2,
|
||||
poly_vals = poly_vals
|
||||
)
|
||||
)
|
||||
|
||||
plot = Figure(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"
|
||||
|
||||
|
||||
script,div = components(plot)
|
||||
|
||||
return script,div
|
||||
|
||||
def interactive_cpchart(rower,thedistances,thesecs,theavpower,
|
||||
theworkouts,promember=0):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user