Commit d2e29a93 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Merge branch 'issue#16' into 'master'

Allow inline plotting and plotting on the the browser.

See merge request !13
parents 72d134d0 19121db7
Pipeline #24170 passed with stages
in 3 minutes and 54 seconds
......@@ -154,7 +154,6 @@ multi_Class_Sampling <- function(in.raster,
new.acc <- list()
decision = "0"
##########################################################################
while (decision == "0") {
for (rs in 1:multiTest) {
########################
......@@ -233,21 +232,50 @@ multi_Class_Sampling <- function(in.raster,
new.names[[rs]] <- index
new.acc[[rs]] <- acc
if (rs == multiTest) {
if (plot_on_browser == TRUE) {
if (.Platform$OS.type == "unix") {
grDevices::x11()
} else {
grDevices::windows()
}
attach(mtcars)
if (multiTest < 4) {
par(mfrow = c(multiTest, 1))
} else {
par(mfrow = c(round(multiTest/4), multiTest %% 4))
}
}
par(mar = c(2, 2, 2, 3), mfrow = n2mfrow(multiTest))
for (rr in 1:length(test)) {
if (plot_on_browser == FALSE) {
png(file = paste(outPath, 'multi_', rr, '.png', sep = ""), width = 600, height = 500, res = 72)
}
plot(
test[[rr]],
col = col(200),
main = "",
legend.shrink = 1)
mtext(side = 3,
paste(rr, classNames[new.names[[rr]]], sep = " "),
paste('Test ', rr, '- class ', classNames[new.names[[rr]]], sep = " "),
font = 2)
if (plot_on_browser == FALSE) {
dev.off()
IRdisplay::display_png(file = paste(outPath, 'multi_', rr, '.png', sep = ""))
}
}
}
}
decision <-
readline("Which distribution is acceptable or sample again (0) [.. or 0]: ")
if (plot_on_browser == FALSE) {
for (rr in 1:length(test)) {
fn <- paste(outPath, 'multi_', rr, '.png', sep = "")
if (file.exists(fn)) {
#Delete file if it exists
file.remove(fn)
}
}
}
}
maFo_rf <- maFo[[as.numeric(decision)]]
index <- new.names[[as.numeric(decision)]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment