Read and Export data¶
The functions in the previous tutorial make plotting pretty automatic, using matplotlib's standard style. But sometimes, you might just want to read the data without immediately plotting itâmaybe to style it your own way or to convert it into a different format.
Customize spinplots¶
In the previous tutorial, we used bruker1d(['../../data/1D/8/pdata/1'], xlim=(250, -20))
to create a simple 13C NMR plot. By adding the option return_fig=True
, you can return the figure object, which allows you to further customize the appearance of the spectrum as you like.
Get Pandas Dataframe¶
A different option is to use the nmr_df
function from spinplots.utils
to get a Pandas DataFrame. This way, you can manipulate the data however you like before plotting.
Pandas DataFrames can be easily exported to other formats such as .csv
. You can do this directly in your code with df.to_csv('exported_data.csv')
, or use the bruker2csv
function from the terminal for a quick export.