drawEEMgg {EEM}R Documentation

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, ...)

## S3 method for class 'EEM'
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, ...)

## S3 method for class 'EEMweight'
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

Details

drawEEM is faster and should be used.

Value

A figure is returned on the graphic device

Methods (by class)

See Also

drawEEM

Examples

## 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)


[Package EEM version 1.1.1 Index]