nmrpy icon indicating copy to clipboard operation
nmrpy copied to clipboard

Plotting

Open AdriennR opened this issue 2 years ago • 1 comments

Helo, Can I plot 2 different spectra on superposition? I only found the plot_array function, but I would like to compare two different spectra by plotting them on the same plot. Is this somehow possible?

Thank you

AdriennR avatar Nov 20 '23 13:11 AdriennR

There is no direct method to do this but it is very easy just using standard matplotlib plotting functions. Every fid object has the associated spectral data (1D numpy array) as an attribute, e.g. fid0.data.

So you could do:

plt.plot(fid0.data)
plt.plot(fid1.data)

Of course you'd have to do some tweaking to convert index position of the array to PPM. If you are unsure look in the source code in plotting.py.

jmrohwer avatar Nov 20 '23 13:11 jmrohwer