My dataset:
I have the following dataset which when plotted using Plotly produces the following result (simplified):
My task:
I want to create an envelope function that extracts the local maxima and minima from data from the above dataset and plots an envelope curve. It would roughly look like this:
I have tried approaching the solutions provided here and the one for the envelope provided here. However, none of them works for me in this approach. For some strange reason, the scatter plots are producing the following results (for local min), which is not exactly what I need.
Here's my code for the initial plot:
import plotly.express as px
import plotly.graph_objects as go
fig= go.Figure()
fig.add_traces(go.Scatter(x= mem_df['time'], y=mem_df['volatge']))
fig.update_layout(xaxis_title = r'$\text{Time } T \text{ in s} $',
yaxis_title = r'$\text{Deflection angle } \text{ in radians}$')
fig.update_layout(title= r'$\text{Deflection angles versus time for the damping sheet}$')
fig.show()
Any help, in this case, would be appreciated! Thank you in advance!