View source: R/plot_MultiExponential.R
plot_MultiExponential | R Documentation |
This function plots multi-exponentially decaying measurements and its signal components. plot_OSLcurve is a wrapper for this function.
This function was black-box tested prior release. These tests as well as code examples are available at: https://luminescence.de/OSLdecomposition/module_tests/Test_plot_MultiExponential.html
plot_MultiExponential(
curve = NULL,
components = NULL,
fill.components = TRUE,
linear.modulation = FALSE,
xlog = FALSE,
ylog = FALSE,
main = NULL,
xlab = "Time",
ylab = "Signal",
xlim = NULL,
ylim = NULL,
font.size = 10,
graph.colors = NULL,
graph.names = NULL,
legend.position = "right",
legend.justification = NULL,
theme.set = ggplot2::theme_classic(),
hide.plot = FALSE
)
curve |
data.frame or matrix or Luminescence::RLum.Data.Curve (optional):
Measured signal curve. First column is used as x-axis, second column is used as y-axis.
Further columns are ignored. If this argument is |
components |
data.frame or numeric vector (optional)
Either table with the signal component parameters or numeric vector with decay rates.
The component parameter table is usually given by fit_OSLcurve or decompose_OSLcurve.
If handmade, it needs the columns |
fill.components |
logical (with default):
If |
linear.modulation |
logical (with default):
If |
xlog |
logical (with default):
If |
ylog |
logical (with default):
If |
main |
character (optional): Plot title, drawn at the top left of the diagram. |
xlab |
character (optional): Axis title of the x-axis. |
ylab |
character (optional): Axis title of the y-axis. |
xlim |
numeric vector (optional):
Minimum and maximum |
ylim |
numeric vector (optional):
Minimum and maximum |
font.size |
numeric (with default): Scale factor for all text elements. Legend title and main title are one bigger |
graph.colors |
character vector (optional): Color for the graphs/stacked areas are defined in the following order: 1. Measurement, 2. Model, 3. Component 1, 4. Component 2, etc. The color vector is allowed to be shorter than the needed colors. For missing colors, the default colors will be used |
graph.names |
character vector (optional): Alternative graph names which shall be displayed in the legend. The names are defined in the following order: 1. Measurement, 2. Model, 3. Residual, 4. Component 1, 5. Component 2, etc.. For missing names, the default names will be used. |
legend.position |
character two-point numeric vector (with default):
Position of the plot legend (for example |
legend.justification |
character two-point numeric vector (with default):
Anchor point for positioning the legend (for example |
theme.set |
ggplot2::ggplot2-package object (with default):
Graphical theme of the output plot. This argument is forwarded to ggplot2::theme_set.
Recommended themes are |
hide.plot |
logical (with default):
If true, plot is not drawn but can still be saved as file or caught by |
Returns an invisible ggplot2::ggplot object containing the plot "Invisible" means, the no value
will be returned (e.g. no console printout) if the function is not assigned to a variable via <-
.
If the function is assigned, the returned object can be further manipulated by ggplot2::ggplot2-package methods
or manually drawn by various functions like for example gridExtra::grid.arrange.
2024-08-29, DM: Forked this function from plot_OSLcurve
Dirk Mittelstraß, dirk.mittelstrass@luminescence.de
Please add the following references to your publication: Your currently used package version, obtained by
citation("OSLdecomposition")
Mittelstraß, D., Schmidt, C., Kreutzer, S., Beyer, J., Straessner, A. and Heitmann, J.: R package OSLdecomposition: Automated signal component analysis of multi-exponential decays for optically stimulated luminescence applications., in preparation.
Bos, A. J. J. and Wallinga, J., 2012. How to visualize quartz OSL signal components, Radiation Measurements, 47(9)
Bulur, E., 2000. A simple transformation for converting CW-OSL curves to LM-OSL curves, Radiation Measurements, 32(2)
plot_OSLcurve, fit_OSLcurve, simulate_OSLcomponents
library(ggplot2)
# Set some arbitrary decay parameters
decay_rates <- c(Fast = 1.2, Medium = 0.2, Slow = 0.02)
# Simulate a CW-OSL curve including some signal noise and signal background
curve <- simulate_OSLcomponents(data.frame(lambda = decay_rates,
n = c(1000, 2000, 10000)),
simulate.curve = TRUE,
add.poisson.noise = TRUE,
add.background = 10)
# Plot the simulated curve and its signal components
plot_MultiExponential(curve, decay_rates)
# For more examples, follow the link to the module tests given in the description section.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.