stamp_png.Rd
Stamp a png image
stamp_png( x0 = 0, y0 = 0, png = system.file("img", "Rlogo.png", package = "png"), image = png::readPNG(png), width = 1, height = width * dim(image)[1]/dim(image)[2], show.legend = F, alpha = 1, x0y0 = NULL )
x0 | numeric x center of shape, defaults to 0 |
---|---|
y0 | numeric y center of shape, defaults to 0 |
png | a string with the path to an image, defaults to R image |
image | a numeric array with png red green blue alpha information, defaults to png::readPNG(png) |
width | the width that the image should fill, defaults to 1 |
height | the height that the image should fill, calculated to match aspect ratio based on width |
alpha | numeric between 0 and 1 indicating transparency, defaults to 1 fully opaque, zero is fully transparent |
x0y0 | dataframe indicating center of shapes, where first column is vector for x values and second column is vector for y values, defaults to NULL |
# stamp in plotspace library(ggplot2) ggplot(cars, aes(dist, speed)) + geom_point() + stamp_png(x0 = 5:11*10, y0 = 10, height = 1, width = 10)#>#>#> Warning: Raster pixels are placed at uneven horizontal intervals and will be shifted. Consider using geom_tile() instead.