NormalizationΒΆ
norm_df = px.normalize(spectra_df=bin_df, method='TotalArea')
px.plot(norm_df.columns, norm_df.iloc[spectrIndex], title='NMR Spectrum after normalization', xlabel='Chemical shift (ppm)')
Note
To plot the first five spectra after normalization
1 traces = [go.Scatter(x=norm_df.columns.values, y=norm_df.to_numpy()[i, :]) for i in range(5)]
2
3 layout = go.Layout(title='Normalization')
4 fig = go.Figure(data=traces, layout=layout)
5 pio.show(fig)