-
Notifications
You must be signed in to change notification settings - Fork 3
/
draw_plot_for_facedetection.R
35 lines (28 loc) · 2.05 KB
/
draw_plot_for_facedetection.R
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
perform_draw <- function(colorData, colorDataDim, colorLabel, xLabel, yLabel, dataDimX, dataDimY, logScale) {
colorMatrix <- read.csv(colorData, header = FALSE)
print(colorMatrix)
png(filename = paste(paste(paste(colorData, "_", sep = ''), colorLabel, sep = ''), ".png", sep = ''))
plot(log(colorMatrix[,dataDimX] + 1) / log(which.max(colorMatrix[,dataDimX]) + 1), colorMatrix[,dataDimY], xlab = xLabel, ylab = yLabel, col = rgb(log(1 + (colorMatrix[, colorDataDim] - colorMatrix[, colorDataDim][which.min(colorMatrix[, colorDataDim])])), 0, 0, maxColorValue = log(1 + (colorMatrix[, colorDataDim][which.max(colorMatrix[, colorDataDim])] - colorMatrix[, colorDataDim][which.min(colorMatrix[, colorDataDim])]))), pch = 19, cex = 1.5, log = logScale, cex.axis = 1.5, cex.lab = 1.5, xaxp = c(0.4, 1, 10), yaxp = c(10, 1000, 1), xlim = c(0.4, 1))
dev.off()
setEPS()
postscript(paste(paste(paste(colorData, "_", sep = ''), colorLabel, sep = ''), ".eps", sep = ''))
plot(log(colorMatrix[,dataDimX] + 1) / log(which.max(colorMatrix[,dataDimX]) + 1), colorMatrix[,dataDimY], xlab = xLabel, ylab = yLabel, col = rgb(log(1 + (colorMatrix[, colorDataDim] - colorMatrix[, colorDataDim][which.min(colorMatrix[, colorDataDim])])), 0, 0, maxColorValue = log(1 + (colorMatrix[, colorDataDim][which.max(colorMatrix[, colorDataDim])] - colorMatrix[, colorDataDim][which.min(colorMatrix[, colorDataDim])]))), pch = 19, cex = 1.5, log = logScale, cex.axis = 1.5, cex.lab = 1.5, xaxp = c(0.4, 1, 10), yaxp = c(10, 1000, 1), xlim = c(0.4, 1))
dev.off()
}
arg <- commandArgs(trailingOnly = TRUE)
argLen <- length(arg)
if (argLen >= 7) {
colorData <- arg[1]
dataDimX <- as.numeric(arg[2])
dataDimY <- as.numeric(arg[3])
colorDataDim <- as.numeric(arg[4])
xLabel <- arg[5]
yLabel <- arg[6]
colorLabel <- arg[7]
logScale <- ""
if (argLen == 8) {
logScale <- arg[8]
}
print(paste("Draw plot on ", arg, " data...", sep = ''))
perform_draw(colorData, colorDataDim, colorLabel, xLabel, yLabel, dataDimX, dataDimY, logScale)
}