Learn R Programming

EEM (version 1.1.1)

drawEEMgg: Draw contour for EEM data using ggplot2

Description

This function draw contour for EEM data using ggplot2. Use `ggsave` to save the contours.

Usage

drawEEMgg(x, ...)
"drawEEMgg"(x, n, textsize = 20, color.palette = matlab.like, nlevels = 20, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", main = NULL, has_legend = TRUE, zlim = NULL, breaks = waiver(), flipaxis = FALSE, ...)
"drawEEMgg"(x, ncomp, textsize = 25, color.palette = matlab.like, nlevels = 20, exlab = "Excitation wavelength [nm]", emlab = "Emission wavelength [nm]", main = NULL, has_legend = TRUE, zlim = NULL, breaks = waiver(), flipaxis = FALSE, ...)

Arguments

x
a list of EEM data generated by readEEM function or EEMweight object generated by extract-related functions.
...
arguments for other methods
n
sample number. The number should not exceed length(EEM)
textsize
(optional) text size
color.palette
(optional) contour color palette. See palette for more details
nlevels
(optional) number of levels used to separate range of intensity value
exlab
(optional) excitation-axis label
emlab
(optional) emission-axis label
main
(optional) plot title
has_legend
logical value for legend
zlim
zlim = c(min, max)
breaks
breaks
flipaxis
(optional) flip axis
ncomp
number of components

Value

A figure is returned on the graphic device

Methods (by class)

  • EEM: draw EEM of EEM data created by readEEM function
  • EEMweight: draw contours of the output from getLoading and getReg.

Details

drawEEM is faster and should be used.

See Also

drawEEM

Examples

Run this code
## Not run: 
# require(EEM)
# require(ggplot2)
# data(applejuice)
# drawEEMgg(applejuice, 1) # draw EEM of sample no.1
# drawEEMgg(applejuice, 1, color.palette = cm.colors) # draw EEM of sample no.31 with different color
# drawEEMgg(applejuice, 1, nlevels = 10) # change nlevels
# 
# # manually define legend values
# drawEEMgg(applejuice, 1, breaks = seq(from = 1000, to = 6000, by = 1000))
# 
# # can be combined with other ggplot2 commands
# # add point to the plot
# drawEEMgg(applejuice, 1) + geom_point(aes(x = 350, y = 500), pch = 17, cex = 10)
# 
# # add grid line to the plot
# drawEEMgg(applejuice, 1) + theme(panel.grid = element_line(color = "grey"), 
# panel.grid.major = element_line(colour = "grey"))
# 
# # add bg color
# drawEEMgg(applejuice, 1, has_legend = FALSE) + geom_raster(aes(fill = value)) +
# geom_contour(colour = "white")
# 
# ## End(Not run)

Run the code above in your browser using DataLab