R中的图表可视化

14

我正在尝试制作图表,想知道是否可以在R语言中制作这样的图片?enter image description here


 myd <- data.frame (categories = c("Planes", "Ships", "Cars", "Trains"), 
values = c(15, 18, 22, 11))

组件图标在这里:

输入图像描述 输入图像描述 输入图像描述 输入图像描述


3
这是可能的,但可能需要大量的工作。请查看https://dev59.com/WXI95IYBdhLWcg3wtwf4,并查看`plotrix`软件包中的`multsymbolbox`。 - Ben Bolker
5
这种图表不符合Tufte测试。用墨水过多,信息量过少。更糟糕的是,很难判断一辆汽车是否比一列火车更值钱。 - Carl Witthoft
1
在科学期刊中,“真实”可能是好的,但在国会、商务会议或公众会议上仍然可能有用。 - shNIL
1个回答

6
我希望这对你的房子或议会地板有所帮助。
编辑:我忘了提及我的参考文献,并添加了一些解释。 enter image description here
library(lattice)
library(grid)


imgs.names <- c('WNinq','7dqJM','9E3Wj','tStmx')
library(png)
images <- lapply(imgs.names, function(x) 
     readPNG(paste(mypath,x,'.png',sep=''),native=TRUE))
## I generate some data because we don't give a reproducible example
x <- c(rep(0,4),rep(10,9),rep(20,3),rep(5,8),rep(4,8),rep(15,4),rep(13,8))
barchart(1:4~x, origin=0, col="yellow",xlim=c(0,30),
             xlab ='values',ylab='categories',title = 'Pictorial',
             scales = list(
               y = list(cex=2,col='blue', at = 1:4,labels = c('Trains','Cars','Ships','Planes')),
               x = list(cex=2,col='blue',at=seq(0,30,by=10))
               ),
             panel=function(x, y, ...) {
                panel.fill(col = rgb(1,1,205/255))    ## I had to pick up the same yellow color!!
                panel.grid()
                lapply(1:4,function(id){
                grid.raster(images[[id]], x=x[which(y==id)],  y=y[which(y==id)],
                           default.units="native",
                           just="left",
                           width =unit(2, "native"),
                           height=unit(0.7, "native"))
                }
            )
          }
         )

@shNIL 我很惊讶他们要求这样的图表! - agstudy

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接