# NOT RUN {
# image glyph
if(requireNamespace("png")) {
img_path <- list.files(file.path(find.package(package = 'ggmulti'),
"images"),
full.names = TRUE)
mercLogo <- png::readPNG(img_path[1L])
p <- ggplot(mapping = aes(x = hp, y = mpg)) +
geom_point(
data = mtcars[!grepl("Merc", rownames(mtcars)), ],
color = "skyblue") +
geom_image_glyph(
data = mtcars[grepl("Merc", rownames(mtcars)), ],
images = mercLogo,
imagewidth = 1.5
)
p
}
# }
Run the code above in your browser using DataLab