gpt4 book ai didi

r - r中的图表

转载 作者:行者123 更新时间:2023-12-03 23:55:18 24 4
gpt4 key购买 nike

我正在尝试开发图表。是否可以在 R 中开发这样的图表?
enter image description here

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

组件图标在这里:

enter image description here
enter image description here
enter image description here
enter image description here

最佳答案

希望这对您的房子/议会楼四楼有所帮助

编辑:我忘了提及我的 reference我添加了一些解释。
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"))
}
)
}
)

关于r - r中的图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14113691/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com