spc.plot.depth.plotly: Display a Spectra object

Description Usage Arguments Examples

Description

Plot a Spectra object with respect to depth

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
spc.plot.depth.plotly(
  sp,
  column,
  plot.max = 10,
  showlegend = FALSE,
  hoverinfo = "name",
  title = sp@LongName
)

## S4 method for signature 'Spectra'
spc.plot.depth.plotly(
  sp,
  column,
  plot.max = 10,
  showlegend = FALSE,
  hoverinfo = "name",
  title = sp@LongName
)

Arguments

sp

A Spectra object

column

Number or name , default value is 10 if a number or name has not been entered

plot.max

numeric value for a maximum number of data in plot

showlegend

logical, to display legend or not, default is FALSE

hoverinfo

a chracter, info about Spectra object to be used in hover box

title

a chracter string, title for plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sp = spc.example_spectra()
BL = spc.makeSpcList(sp,"CAST")
p1<-spc.plot.depth.plotly(BL[[5]])
#p1<-layout(p1,title=paste("CAST =", BL[[5]]$CAST[1]))
p2<-spc.plot.depth.plotly(BL[[4]])
#p2<-plotly::layout(p2,title=paste("CAST =", BL[[4]]$CAST[1]))
p <- plotly::subplot(p1, p2,  margin = 0.05, shareY=TRUE,shareX=TRUE,titleX=TRUE,titleY=TRUE)
p <- plotly::layout(p, showlegend = TRUE, 
annotations = list(
list(x = 0.2 , y = 1.05, text = BL[[5]]$CAST[1], showarrow = FALSE, xref='paper', yref='paper'),
list(x = 0.8 , y = 1.05, text = BL[[4]]$CAST[1], showarrow = FALSE, xref='paper', yref='paper')))
p

Example output



geoSpectral documentation built on Feb. 20, 2020, 5:08 p.m.