Is it possible to display custom image (say png format) as geom_point in R ggplot?
library(png)
pic1 <- readPNG("pic1.png")
png("Heatmap.png", units="px", width=3200, height=3200, res=300)
ggplot(data_frame, aes(medium, day, fill = Transactions)) +
geom_tile(colour="white") +
facet_grid(dime3_year~dime3_month) +
scale_fill_gradient(high="blue",low="white") +
theme_bw() +
geom_point(aes(dime3_channel, day, size=Conv,alpha=Conv,image=(annotation_raster(pic1,xmin=0,ymin=0,xmax=5,ymax=5)),color="firebrick")) +
Gives error:
Don't know how to automatically pick scale for object of type proto/environment. Defaulting to continuous Error: Aesthetics must either be length one, or the same length as the dataProblems:(annotation_raster(conv_pic, xmin = 0, ymin = 0, xmax = 5, ymax = 5))
grImport2
, e.g. first example here, or Fig 11 withlattice
here. Nice article ongrImport
here (see e.g. fig 8, also withlattice
). – Kordofan