Description Usage Arguments Examples
View source: R/geom-textured-rect.R
geom_textured_rect()
draws rectangles that are filled with
texture images.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... |
Other arguments passed on to |
img_width |
Unit object specifying the width of the texture image.
If |
img_height |
Unit object specifying the height of the texture image.
If |
nrow |
Number of image rows. If |
ncol |
Number of image columns. If |
interpolate |
A logical value indicating whether to linearly interpolate the image (the alternative is to use nearest-neighbour interpolation, which gives a more blocky result). |
legend_key_params |
A list holding additional parameters to be handed off
to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(ggplot2)
library(tibble)
library(magick)
data <- tibble(
xmin = c(1, 2.5), ymin = c(1, 1), xmax = c(2, 4), ymax = c(4, 3),
image = list(
"https://jeroen.github.io/images/Rlogo.png",
image_read_svg("https://jeroen.github.io/images/tiger.svg")
)
)
ggplot(data, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, image = image)) +
geom_textured_rect(img_width = unit(1, "in"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.