Peakidtext: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Jeremy
(Importing text file)
Line 1: Line 1:
===Purpose===
===Purpose===
Writes peak ID information on present graph of a set of peaks.
Writes peak ID information on present graph of a set of peaks.
===Synopsis===
===Synopsis===
:h = peakidtext(peakdef)
:h = peakidtext(peakdef)
===Description===
===Description===
When a set of peaks is plotted, PEAKIDTEXT can be used to put the peak id (peakdef.id) on the graph (see PEAKSTRUCT). For example, if (ax) is the wavelength, frequency, or time axis and (y) is a set of peaks then, for an initial guess given in (peakdef) the fit parameters are obtained using:
When a set of peaks is plotted, PEAKIDTEXT can be used to put the peak id (peakdef.id) on the graph (see PEAKSTRUCT). For example, if (ax) is the wavelength, frequency, or time axis and (y) is a set of peaks then, for an initial guess given in (peakdef) the fit parameters are obtained using:
:peakdefo = fitpeaks(peakdef,y,ax);
:peakdefo = fitpeaks(peakdef,y,ax);
A plot can be made using:
A plot can be made using:
:plot(ax,y,'b',ax,peakfunction(peakdefo,ax),'r')
:plot(ax,y,'b',ax,peakfunction(peakdefo,ax),'r')
Next, labels are put on the graph using:
Next, labels are put on the graph using:
:peakidtext(peakdefo)
:peakidtext(peakdefo)
This also puts a vertical line at the peak center and puts the text label, based on the  contents of the (peakdefo.id) field, near the peak maximum.
This also puts a vertical line at the peak center and puts the text label, based on the  contents of the (peakdefo.id) field, near the peak maximum.
====INPUTS====
====INPUTS====
* '''peakdef''' = a standard peak structure (see PEAKSTRUCT).
* '''peakdef''' = a standard peak structure (see PEAKSTRUCT).
====OUTPUTS====
====OUTPUTS====
* '''h''' = vector of handles corresponding to the individual text labels.
* '''h''' = vector of handles corresponding to the individual text labels.
===See Also===
===See Also===
[[fitpeaks]], [[peakfunction]], [[peakstruct]]
[[fitpeaks]], [[peakfunction]], [[peakstruct]]

Revision as of 15:26, 3 September 2008

Purpose

Writes peak ID information on present graph of a set of peaks.

Synopsis

h = peakidtext(peakdef)

Description

When a set of peaks is plotted, PEAKIDTEXT can be used to put the peak id (peakdef.id) on the graph (see PEAKSTRUCT). For example, if (ax) is the wavelength, frequency, or time axis and (y) is a set of peaks then, for an initial guess given in (peakdef) the fit parameters are obtained using:

peakdefo = fitpeaks(peakdef,y,ax);

A plot can be made using:

plot(ax,y,'b',ax,peakfunction(peakdefo,ax),'r')

Next, labels are put on the graph using:

peakidtext(peakdefo)

This also puts a vertical line at the peak center and puts the text label, based on the contents of the (peakdefo.id) field, near the peak maximum.

INPUTS

  • peakdef = a standard peak structure (see PEAKSTRUCT).

OUTPUTS

  • h = vector of handles corresponding to the individual text labels.

See Also

fitpeaks, peakfunction, peakstruct