layer_barchart | R Documentation |
layer_barchart
layer_barchart(
mapping = NULL,
data = NULL,
brks,
cols,
x = 0,
y = 0,
width = unit(0.5, "npc"),
height = unit(0.5, "npc"),
just = c(0, 0),
fontsize = 12,
theme = NULL,
...
)
geom_barchart(
mapping = NULL,
data = NULL,
brks,
cols,
x = 0,
y = 0,
width = unit(0.5, "npc"),
height = unit(0.5, "npc"),
just = c(0, 0),
fontsize = 12,
theme = NULL,
...
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
x |
A numeric vector or unit object specifying x-location. |
y |
A numeric vector or unit object specifying y-location. |
width |
Bar width. By default, set to 90% of the |
height |
A numeric vector or unit object specifying height. |
just |
Adjustment for column placement. Set to |
... |
Other arguments passed on to
|
library(gg.layers)
library(ggplot2)
library(rcolors)
data("d_trendPerc")
d_mask <- mutate(d_trendPerc, mask = perc <= 0.99) # %>% as.data.frame()
brks = seq(0.9, 1, 0.025)
nbrk = length(brks) - 1
cols <- get_color(rcolors$amwg256, nbrk)
# the part of not significant
ggplot(data = d_mask, aes(x, y)) +
geom_raster(aes(fill = perc)) +
layer_barchart(aes(z = perc),
width = unit(0.3, "npc"),
height = unit(0.3, "npc"),
brks = brks, cols = cols)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.