Có thể hiển thị hình ảnh tùy chỉnh (có định dạng png) làm geom_point trong R ggplot không?Hiển thị hình ảnh tùy chỉnh dưới dạng geom_point
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")) +
Cho lỗi:
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))
Tôi sẽ bắt đầu với gói ** grImport **. Một số ** lưới ** tinkering có thể được yêu cầu. – joran
Xem thêm 'grImport2', ví dụ: ví dụ đầu tiên [** here **] (https://sjp.co.nz/projects/grimport2/), hoặc Hình 11 với 'mạng lưới [** ở đây **] (https://sjp.co.nz /projects/grimport2/grImport2.html). Bài viết hay về 'grImport' [** here **] (http://www.jstatsoft.org/v30/i04/paper) (xem ví dụ 8, cũng với' mạng '). – Henrik
cũng xem http://stackoverflow.com/questions/36133374/custom-legend-with-imported-images – baptiste