plot_RLum.Data.Spectrum: Plot function for an RLum.Data.Spectrum S4 class object

Description Usage Arguments Details Value Function version How to cite Note Author(s) See Also Examples

View source: R/plot_RLum.Data.Spectrum.R

Description

The function provides a standardised plot output for spectrum data of an RLum.Data.Spectrum S4 class object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
plot_RLum.Data.Spectrum(
  object,
  par.local = TRUE,
  plot.type = "contour",
  optical.wavelength.colours = TRUE,
  bg.spectrum = NULL,
  bg.channels = NULL,
  bin.rows = 1,
  bin.cols = 1,
  norm = NULL,
  rug = TRUE,
  limit_counts = NULL,
  xaxis.energy = FALSE,
  legend.text,
  ...
)

Arguments

object

RLum.Data.Spectrum or matrix (required): S4 object of class RLum.Data.Spectrum or a matrix containing count values of the spectrum.
Please note that in case of a matrix rownames and colnames are set automatically if not provided.

par.local

logical (with default): use local graphical parameters for plotting, e.g. the plot is shown in one column and one row. If par.local = FALSE global parameters are inherited.

plot.type

character (with default): plot type, for 3D-plot use persp, or interactive, for a 2D-plot contour, single or multiple.lines (along the time or temperature axis) or transect (along the wavelength axis)

optical.wavelength.colours

logical (with default): use optical wavelength colour palette. Note: For this, the spectrum range is limited: c(350,750). Own colours can be set with the argument col. If you provide already binned spectra, the colour assignment is likely to be wrong, since the colour gradients are calculated using the bin number.

bg.spectrum

RLum.Data.Spectrum or matrix (optional): Spectrum used for the background subtraction. By definition, the background spectrum should have been measured with the same setting as the signal spectrum. If a spectrum is provided, the argument bg.channels works only on the provided background spectrum.

bg.channels

vector (optional): defines channel for background subtraction If a vector is provided the mean of the channels is used for subtraction. If a spectrum is provided via bg.spectrum, this argument only works on the bg.spectrum.

Note: Background subtraction is applied prior to channel binning

bin.rows

integer (with default): allow summing-up wavelength channels (horizontal binning), e.g. bin.rows = 2 two channels are summed up. Binning is applied after the background subtraction.

bin.cols

integer (with default): allow summing-up channel counts (vertical binning) for plotting, e.g. bin.cols = 2 two channels are summed up. Binning is applied after the background subtraction.

norm

character (optional): Normalise data to the maximum (norm = "max") or minimum (norm = "min") count values. The normalisation is applied after the binning.

rug

logical (with default): enables or disables colour rug. Currently only implemented for plot type multiple.lines and single

limit_counts

numeric (optional): value to limit all count values to this value, i.e. all count values above this threshold will be replaced by this threshold. This is helpful especially in case of TL-spectra.

xaxis.energy

logical (with default): enables or disables energy instead of wavelength axis. For the conversion the function convert_Wavelength2Energy is used.

Note: This option means not only simnply redrawing the axis, instead the spectrum in terms of intensity is recalculated, s. details.

legend.text

character (with default): possiblity to provide own legend text. This argument is only considered for plot types providing a legend, e.g. plot.type="transect"

...

further arguments and graphical parameters that will be passed to the plot function.

Details

Matrix structure
(cf. RLum.Data.Spectrum)

Note: This nomenclature is valid for all plot types of this function!

Nomenclature for value limiting

Details on the plot functions

Spectrum is visualised as 3D or 2D plot. Both plot types are based on internal R plot functions.

plot.type = "persp"

Arguments that will be passed to persp:

Note: Further parameters can be adjusted via par. For example to set the background transparent and reduce the thickness of the lines use: par(bg = NA, lwd = 0.7) previous the function call.

plot.type = "single"

Per frame a single curve is returned. Frames are time or temperature steps.

plot.type = "multiple.lines"

All frames plotted in one frame.

plot.type = "transect"

Depending on the selected wavelength/channel range a transect over the time/temperature (y-axis) will be plotted along the wavelength/channels (x-axis). If the range contains more than one channel, values (z-values) are summed up. To select a transect use the xlim argument, e.g. xlim = c(300,310) plot along the summed up count values of channel 300 to 310.

Further arguments that will be passed (depending on the plot type)

xlab, ylab, zlab, xlim, ylim, zlim, main, mtext, pch, type ("single", "multiple.lines", "interactive"), col, border, box lwd, bty, showscale ("interactive")

Value

Returns a plot.

Function version

0.6.2

How to cite

Kreutzer, S., 2020. plot_RLum.Data.Spectrum(): Plot function for an RLum.Data.Spectrum S4 class object. Function version 0.6.2. In: Kreutzer, S., Burow, C., Dietze, M., Fuchs, M.C., Schmidt, C., Fischer, M., Friedrich, J., 2020. Luminescence: Comprehensive Luminescence Dating Data Analysis. R package version 0.9.7. https://CRAN.R-project.org/package=Luminescence

Note

Not all additional arguments (...) will be passed similarly!

Author(s)

Sebastian Kreutzer, IRAMAT-CRP2A, UMR 5060, CNRS - Université Bordeaux Montaigne (France) , RLum Developer Team

See Also

RLum.Data.Spectrum, convert_Wavelength2Energy, plot, plot_RLum, persp, plotly::plot_ly, contour

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
##load example data
data(ExampleData.XSYG, envir = environment())

##(1)plot simple spectrum (2D) - contour
plot_RLum.Data.Spectrum(TL.Spectrum,
                        plot.type="contour",
                        xlim = c(310,750),
                        ylim = c(0,300),
                        bin.rows=10,
                        bin.cols = 1)

##(2) plot spectrum (3D)
plot_RLum.Data.Spectrum(
  TL.Spectrum,
  plot.type="persp",
  xlim = c(310,750),
  ylim = c(0,100),
  bin.rows=10,
  bin.cols = 1)

##(3) plot spectrum on energy axis
##please note the background subtraction
plot_RLum.Data.Spectrum(TL.Spectrum,
plot.type="persp",
ylim = c(0,200),
bin.rows=10,
bg.channels = 10,
bin.cols = 1,
xaxis.energy = TRUE)

##(4) plot multiple lines (2D) - multiple.lines (with ylim)
plot_RLum.Data.Spectrum(
 TL.Spectrum,
 plot.type="multiple.lines",
 xlim = c(310,750),
 ylim = c(0,100),
 bin.rows=10,
 bin.cols = 1)

## Not run: 
 ##(4) interactive plot using the package plotly ("surface")
 plot_RLum.Data.Spectrum(TL.Spectrum, plot.type="interactive",
 xlim = c(310,750), ylim = c(0,300), bin.rows=10,
 bin.cols = 1)

 ##(5) interactive plot using the package plotly ("contour")
 plot_RLum.Data.Spectrum(TL.Spectrum, plot.type="interactive",
 xlim = c(310,750), ylim = c(0,300), bin.rows=10,
 bin.cols = 1,
 type = "contour",
 showscale = TRUE)

 ##(6) interactive plot using the package plotly ("heatmap")
 plot_RLum.Data.Spectrum(TL.Spectrum, plot.type="interactive",
 xlim = c(310,750), ylim = c(0,300), bin.rows=10,
 bin.cols = 1,
 type = "heatmap",
 showscale = TRUE)

 ##(7) alternative using the package fields
 fields::image.plot(get_RLum(TL.Spectrum))
 contour(get_RLum(TL.Spectrum), add = TRUE)


## End(Not run)

R-Lum/Luminescence documentation built on Jan. 4, 2020, 10:44 p.m.