| plotly_spec | R Documentation |
These functions generate heatmaps, spectral plots, and interactive plots for OpenSpecy data.
plotly_spec(x, ...)
## Default S3 method:
plotly_spec(x, ...)
## S3 method for class 'OpenSpecy'
plotly_spec(
x,
x2 = NULL,
model = NULL,
model_class = NULL,
model_colorscale = list(c(0, "#d73027"), c(0.5, "#fee08b"), c(1, "#1a9850")),
model_opacity = 0.28,
line = list(color = "rgb(255, 255, 255)"),
line2 = list(dash = "dot", color = "rgb(255,0,0)"),
font = list(color = "#FFFFFF"),
plot_bgcolor = "rgba(17, 0, 73, 0)",
paper_bgcolor = "rgb(0, 0, 0)",
showlegend = FALSE,
make_rel = TRUE,
...
)
model_class_weights(model, model_class)
heatmap_spec(x, ...)
## Default S3 method:
heatmap_spec(x, ...)
## S3 method for class 'OpenSpecy'
heatmap_spec(
x,
z = NULL,
sn = NULL,
cor = NULL,
min_sn = NULL,
min_cor = NULL,
select = NULL,
font = list(color = "#FFFFFF"),
plot_bgcolor = "rgba(17, 0, 73, 0)",
paper_bgcolor = "rgb(0, 0, 0)",
colorscale = "Viridis",
showlegend = FALSE,
type = "interactive",
...
)
interactive_plot(x, ...)
## Default S3 method:
interactive_plot(x, ...)
## S3 method for class 'OpenSpecy'
interactive_plot(
x,
x2 = NULL,
select = NULL,
line = list(color = "rgb(255, 255, 255)"),
line2 = list(dash = "dot", color = "rgb(255,0,0)"),
font = list(color = "#FFFFFF"),
plot_bgcolor = "rgba(17, 0, 73, 0)",
paper_bgcolor = "rgb(0, 0, 0)",
colorscale = "Viridis",
...
)
x |
an |
x2 |
an optional second |
model |
optional model library returned by |
model_class |
exact trained class label whose signed logistic coefficients should be displayed. Positive weights are green, values near zero yellow, and negative weights red. These are model weights, not causal peak attributions. |
model_colorscale |
continuous Plotly colorscale for signed model weights, centered at zero. |
model_opacity |
opacity of the model-weight background from zero to one. |
line |
list; |
line2 |
list; |
font |
list; passed to |
plot_bgcolor |
color value; passed to |
paper_bgcolor |
color value; passed to |
showlegend |
whether to show the legend passed to |
make_rel |
logical, whether to make the spectra relative or use the raw values |
z |
optional numeric vector specifying the intensity values for the
heatmap. If not provided, the function will use the intensity values from the
|
sn |
optional numeric value specifying the signal-to-noise ratio
threshold. If provided along with |
cor |
optional numeric value specifying the correlation threshold. If
provided along with |
min_sn |
optional numeric value specifying the minimum signal-to-noise ratio for inclusion in the heatmap. Regions with SNR below this threshold will be excluded. |
min_cor |
optional numeric value specifying the minimum correlation for inclusion in the heatmap. Regions with correlation below this threshold will be excluded. |
select |
optional index of the selected spectrum to highlight on the heatmap. |
colorscale |
colorscale passed to |
type |
specification for plot type either interactive or static
|
... |
further arguments passed to |
A plotly heatmap object displaying the OpenSpecy data. A subplot
containing the heatmap and spectra plot. A plotly object displaying the
spectra from the OpenSpecy object(s).
Win Cowger, Zacharias Steinmetz
if (interactive()) {
data("raman_hdpe")
tiny_map <- read_extdata("CA_tiny_map.zip") |> read_zip()
plotly_spec(raman_hdpe)
heatmap_spec(tiny_map, z = tiny_map$metadata$y, showlegend = TRUE)
sample_spec(tiny_map, size = 12) |>
interactive_plot(select = 2, x2 = raman_hdpe)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.