View source: R/ggplot.spectra.R
ggplot.spectra | R Documentation |
ggplot()
initializes a ggplot object. It can be used to
declare the input spectra object for a graphic and to optionally specify the
set of plot aesthetics intended to be common throughout all
subsequent layers unless specifically overridden.
## S3 method for class 'spectra'
ggplot(
data,
mapping = NULL,
...,
wl = NULL,
w.unit = "nm",
environment = parent.frame()
)
data |
Default spectra database to use for plot. If not a spectra database, the
methods used will be those defined in package |
mapping |
Default list of aesthetic mappings to use for plot. If not specified, in the case of spectra objects, a default mapping will be used. |
... |
Other arguments passed on to methods. Not currently used. |
wl |
numeric The wavelength vector. |
w.unit |
character The wavelength unit of the spectra. |
environment |
If an variable defined in the aesthetic mapping is not
found in the data, ggplot will look for it in this environment. It defaults
to using the environment in which |
ggplot()
is typically used to construct a plot
incrementally, using the + operator to add layers to the
existing ggplot object. This is advantageous in that the
code is explicit about which layers are added and the order
in which they are added. For complex graphics with multiple
layers, initialization with ggplot
is recommended.
Current implementation does not merge default mapping with user supplied mapping. If user supplies a mapping, it is used as is. To add to the default mapping, aes() can be used by itself to compose the ggplot.
?ggpmisc::ggplot()
library(visa)
library(ggplot2)
ggplot.spectra(NSpec.DF)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.