scale-gradient | R Documentation |
Color scale for continuous data
v_scale_colour_gradient(
vc,
name = NULL,
low = "#132B43",
high = "#56B1F7",
limits = NULL,
position = c("right", "bottom", "left", "top"),
align = c("middle", "start", "end")
)
v_scale_fill_gradient(
vc,
name = NULL,
low = "#132B43",
high = "#56B1F7",
limits = NULL,
position = c("right", "bottom", "left", "top"),
align = c("middle", "start", "end")
)
vc |
An htmlwidget created with |
name |
Title for the legend. |
low , high |
Colours for low and high ends of the gradient. |
limits |
Limits of the scale, default ( |
position |
Position of the legend. |
align |
Alignment of the legend. |
A vchart()
htmlwidget
object.
library(vchartr)
data("penguins", package = "palmerpenguins")
vchart(penguins) %>%
v_scatter(aes(
x = bill_length_mm,
y = bill_depth_mm,
color = body_mass_g
)) %>%
v_scale_colour_gradient(
name = "Body mass",
low = "yellow",
high = "red"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.