Duy Dinh - 2012-03-11
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#-----------------------------------
# R script to display MAP results over the number of expansion documents and the number of expansion terms
#
# @author: Duy Dinh, University of Toulouse
# @date: 10 March 2012
##-----------------------------------

library(rgl)

# directory containing evaluation results files
# each file has the format 4 columns: xterms xdocs RunID MAP (see in the example below)
path <- "/home/user/Desktop/dataFolder"

files <- list.files(path, full.names=TRUE)
names <- list.files(path)

# number of files
n <- length(files)

# distribute plots on the grid
par(mfrow=c(n/3,n/3))

tickLabs=c(0, 10, 20, 30, 40, 50) 
xTickCount=5
yTickCount=5
zTickCount=4

min=5
max=50
minMAP=0.0
maxMAP=0.4

# read data from files
for (i in 1: n){
    data <- read.table(files[i], header=FALSE) 
    scatterplot3d(data$V1, data$V2, data$V4,
        color="blue", type="p", xlab="#terms", ylab="#docs",  zlab="MAP", 
        lab=c(xTickCount, yTickCount, 0),
        lab.z=c(zTickCount, 0, 0),
        xlim=c(min, max), ylim=c(min, max),
        zlim=c(minMAP, maxMAP),
        pch=20, main=list(names[i], font=2)
    )
}

#dev.off()
 

Last edit: Duy Dinh 2013-02-26