2013-01-01 3 views
13

私は絵画図を作成しようとしています。このようなチャートをRで開発することは可能ですか? enter image description hererの絵図

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

コンポーネントのアイコンはここにある:

enter image description here これは、4つのあなたの家/議会床

編集参考になることをenter image description here enter image description here enter image description here

+3

それは確かに*可能*だが、それはおそらく、かなりの作業がかかります。 http://stackoverflow.com/questions/2181902/how-to-use-an-image-as-a-pointpoint-in-ggplotを見て、 'plotrix'パッケージの' multsymbolbox'を見てください –

+5

これはダイアフラムの一種がタフテ(Tufte)テストを一掃する。情報が少なすぎるとインクが多すぎます。さらに悪いことに、1台の車が複数の列車に相当するかどうかを判断することは困難です。 –

+1

真は科学ジャーナルでは良いかもしれませんが、それでも家/議会のフロア、ビジネスミーティングや一般公開ミーティングでは役立ちます。 – shNIL

答えて

6

希望:私は忘れて私の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")) 
       } 
      ) 
      } 
     ) 
+0

おかげさまで、おかげさまで床に行くでしょう – shNIL

+0

@shNIL私は彼らがそのような図を求めているのに驚いています! – agstudy