是否可以使用自定义图片作为条形图中的酒吧?

我有我想要绘制的数据,而不是显示y轴值的常规竖线,我想要:

1)用图片填满吧台(例如圣诞节装饰图案)

2)使用自定义的图片(如蜡烛,比方说)作为酒吧

这可能吗? 我的首选平台是R,Excel或Tableau公开的。

你可以试试

library(jpeg) library(grid) library(lattice) #download Chrismas tree image which will be used as bar in barplot download.file("https://upload.wikimedia.org/wikipedia/commons/f/fa/Poinsettia_tree.jpg", "Poinsettia_tree.jpg") chrismas_tree <- readJPEG("Poinsettia_tree.jpg") #sample data for barplot counts <- table(mtcars$gear) #barplot barchart(counts, origin=0, col="white",horizontal = FALSE, panel=function(x, y, ...) { panel.barchart(x, y, ...) grid.raster(chrismas_tree, y=0, height=y, x=x, default.units="native", just="bottom", width=unit(0.2,"npc")) }, ylab = "Counts", xlab = "Gear", main = "Gear counts plot (mtcars)") 

输出图

在Excel 2013中,您可以使用图像文件填充图表中的列。 通过右击select列,然后从popup菜单中select格式数据点。 select油漆桶选项卡,在填充选项下select图片或纹理填充,然后从文件插入图片。 图像现在覆盖在图表的列上。