Automatically set maximum x-scale limit based on peak frequency

master
Dan Howe 5 years ago
parent 8b0022c054
commit af754786d9

@ -146,12 +146,15 @@ def read_json_data(json_data):
trace = go.Scatter(x=dfs.index, y=dfs[col], name=col, opacity=0.8)
spec.append(trace)
# Set maximum x limit to 200% of the peak frequency
f_max = dfs.idxmax().mean() * 3
graph_energy = dcc.Graph(id='energy-spectrum',
figure={
'data': spec,
'layout': {
'xaxis': {
'range': [0, 3]
'range': [0, f_max]
}
}
})

Loading…
Cancel
Save