Difference between revisions of "Slice 2d.m"
(→Examples) |
(Sync syntax/arguments/outputs with current Spinach source) |
||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:slice_2d.m}} __NOTOC__ | {{DISPLAYTITLE:slice_2d.m}} __NOTOC__ | ||
| + | |||
Contour plotting utility with non-linear adaptive contour spacing and slice extraction using mouse. The function is useful for NMR data where small cross-peaks must be adequately contoured next to large diagonal peaks. | Contour plotting utility with non-linear adaptive contour spacing and slice extraction using mouse. The function is useful for NMR data where small cross-peaks must be adequately contoured next to large diagonal peaks. | ||
==Syntax== | ==Syntax== | ||
| − | + | slice_2d(spin_system,spectrum,parameters,ncont,delta,k,ncol,m,signs) | |
==Arguments== | ==Arguments== | ||
| − | + | spectrum - a real matrix containing the 2D NMR spectrum | |
| − | + | ||
parameters.sweep - one or two sweep widths, Hz | parameters.sweep - one or two sweep widths, Hz | ||
| − | + | ||
parameters.spins - cell array with one ot two character | parameters.spins - cell array with one ot two character | ||
strings specifying the working spins | strings specifying the working spins | ||
| − | + | ||
parameters.offset - one or two transmitter offsets, Hz | parameters.offset - one or two transmitter offsets, Hz | ||
| − | + | ||
| + | parameters.zerofill - one or two point counts in F1 and F2 | ||
| + | |||
parameters.axis_units - axis units ('ppm','Hz','Gauss') | parameters.axis_units - axis units ('ppm','Hz','Gauss') | ||
| − | + | ||
ncont - the number of contours, a reasonable value is 20 | ncont - the number of contours, a reasonable value is 20 | ||
| − | + | ||
delta - minimum and maximum elevation (as a fraction of the | delta - minimum and maximum elevation (as a fraction of the | ||
total intensity) of the contours above the baseline. | total intensity) of the contours above the baseline. | ||
| Line 26: | Line 29: | ||
first pair of numbers refers to the positive conto- | first pair of numbers refers to the positive conto- | ||
urs and the second pair to the negative ones. | urs and the second pair to the negative ones. | ||
| − | + | ||
k - a coefficient that controls the curvature of the contour | k - a coefficient that controls the curvature of the contour | ||
spacing function: k=1 corresponds to linear spacing and | spacing function: k=1 corresponds to linear spacing and | ||
k>1 bends the spacing curve to increase the sampling den- | k>1 bends the spacing curve to increase the sampling den- | ||
sity near the baseline. A reasonable value is 2. | sity near the baseline. A reasonable value is 2. | ||
| − | + | ||
ncol - number of colours in the colour map; around 256 is fine | ncol - number of colours in the colour map; around 256 is fine | ||
| − | + | ||
m - the curvature of the colour map: m=1 corresponds to a li- | m - the curvature of the colour map: m=1 corresponds to a li- | ||
near colour ramp into the red for positive contours, and | near colour ramp into the red for positive contours, and | ||
into the blue for negative contours. A reasonable value | into the blue for negative contours. A reasonable value | ||
for high-contrast plotting is 6. | for high-contrast plotting is 6. | ||
| − | + | ||
signs - can be set to 'positive', 'negative' or 'both' - this | signs - can be set to 'positive', 'negative' or 'both' - this | ||
will cause the corresponding contours to be plotted. | will cause the corresponding contours to be plotted. | ||
| Line 44: | Line 47: | ||
==Outputs== | ==Outputs== | ||
| − | + | this function creates a figure | |
==Examples== | ==Examples== | ||
| + | |||
Below is the output of examples/esr_solids/hyscore_nitroxide_powder.m example file. When [[plot_2d.m]] call at the end of the file is replaced with a [[slice_2d.m]] call, two more planels containing horizontal and vertical slices appear on the left. | Below is the output of examples/esr_solids/hyscore_nitroxide_powder.m example file. When [[plot_2d.m]] call at the end of the file is replaced with a [[slice_2d.m]] call, two more planels containing horizontal and vertical slices appear on the left. | ||
| Line 52: | Line 56: | ||
==Notes== | ==Notes== | ||
| + | |||
The following functions are used to compute contour levels: | The following functions are used to compute contour levels: | ||
| Line 60: | Line 65: | ||
==See also== | ==See also== | ||
| + | |||
[[plot_1d.m]], [[plot_3d.m]], [[volplot.m]], [[molplot.m]], [[mri_2d_plot.m]], [[plot_2d.m]] | [[plot_1d.m]], [[plot_3d.m]], [[volplot.m]], [[molplot.m]], [[mri_2d_plot.m]], [[plot_2d.m]] | ||
''Version 2.3, authors: [[Ilya Kuprov]]'' | ''Version 2.3, authors: [[Ilya Kuprov]]'' | ||
Revision as of 15:06, 5 April 2026
Contour plotting utility with non-linear adaptive contour spacing and slice extraction using mouse. The function is useful for NMR data where small cross-peaks must be adequately contoured next to large diagonal peaks.
Syntax
slice_2d(spin_system,spectrum,parameters,ncont,delta,k,ncol,m,signs)
Arguments
spectrum - a real matrix containing the 2D NMR spectrum
parameters.sweep - one or two sweep widths, Hz
parameters.spins - cell array with one ot two character
strings specifying the working spins
parameters.offset - one or two transmitter offsets, Hz
parameters.zerofill - one or two point counts in F1 and F2
parameters.axis_units - axis units ('ppm','Hz','Gauss')
ncont - the number of contours, a reasonable value is 20
delta - minimum and maximum elevation (as a fraction of the
total intensity) of the contours above the baseline.
A good starting value is [0.02 0.2 0.02 0.2]. The
first pair of numbers refers to the positive conto-
urs and the second pair to the negative ones.
k - a coefficient that controls the curvature of the contour
spacing function: k=1 corresponds to linear spacing and
k>1 bends the spacing curve to increase the sampling den-
sity near the baseline. A reasonable value is 2.
ncol - number of colours in the colour map; around 256 is fine
m - the curvature of the colour map: m=1 corresponds to a li-
near colour ramp into the red for positive contours, and
into the blue for negative contours. A reasonable value
for high-contrast plotting is 6.
signs - can be set to 'positive', 'negative' or 'both' - this
will cause the corresponding contours to be plotted.
Outputs
this function creates a figure
Examples
Below is the output of examples/esr_solids/hyscore_nitroxide_powder.m example file. When plot_2d.m call at the end of the file is replaced with a slice_2d.m call, two more planels containing horizontal and vertical slices appear on the left.
Notes
The following functions are used to compute contour levels:
cont_levs_pos=delta(2)*smax*linspace(0,1,ncont).^k+smax*delta(1); cont_levs_neg=delta(2)*smin*linspace(0,1,ncont).^k+smin*delta(1);
where smin and smax are computed from the spectrum matrix.
See also
plot_1d.m, plot_3d.m, volplot.m, molplot.m, mri_2d_plot.m, plot_2d.m
Version 2.3, authors: Ilya Kuprov
