X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=Rscripts%2Fafc_graph.R;h=8a62d8ad0f133c1e9e458a9a6987aa7b4feb7ee0;hp=017b782a58ef568c74e023c01aea39c0817f8582;hb=ad8fe486b34f1cee918ea8564bf909e30cd25328;hpb=9bde3d55d2131f1a33234a43c0de8b200ddb8f9a diff --git a/Rscripts/afc_graph.R b/Rscripts/afc_graph.R index 017b782..8a62d8a 100644 --- a/Rscripts/afc_graph.R +++ b/Rscripts/afc_graph.R @@ -31,10 +31,9 @@ tchi <- %s tchi.min <- %i tchi.max <- %i dirout <- '%s' -#xmin <- xmin -#xmax <- xmax -#ymin <- ymin -#ymax <- ymax +do.svg <- %s +xminmax <- NULL +yminmax <- NULL xlab <- paste('facteur ', x, ' -') ylab <- paste('facteur ', y, ' -') @@ -133,7 +132,11 @@ if ( qui == 3 ) { infp <- which(is.infinite(maxchi) & maxchi > 0) if (length(infp)) { maxchi[infp] <- NA - valmax <- max(maxchi, na.rm = TRUE) + if (!length(infp) == length(maxchi)) { + valmax <- max(maxchi, na.rm = TRUE) + } else { + valmax <- 8 + } maxchi[infp] <- valmax + 2 } if (cex.txt) { @@ -149,21 +152,27 @@ if ( qui == 3 ) { } } +if (is.null(xminmax)) { + xminmax <- c(min(table.in[,1], na.rm = TRUE) + ((max(cex.par)/10) * min(table.in[,1], na.rm = TRUE)), max(table.in[,1], na.rm = TRUE) + ((max(cex.par)/10) * max(table.in[,1], na.rm = TRUE))) + } + if (is.null(yminmax)) { + yminmax <- c(min(table.in[,2], na.rm = TRUE) + ((max(cex.par)/10) * min(table.in[,2], na.rm = TRUE)), max(table.in[,2], na.rm = TRUE) + ((max(cex.par)/10) * max(table.in[,2], na.rm = TRUE))) + } if (typegraph == 0) { - open_file_graph(fileout, width = width, height = height) + open_file_graph(fileout, width = width, height = height, svg = do.svg) parcex <- taillecar/10 par(cex = parcex) if (over) { table.in <- table.in[order(cex.par, decreasing = TRUE),] classes <- classes[order(cex.par, decreasing = TRUE)] cex.par <- cex.par[order(cex.par, decreasing = TRUE)] - table.in <- stopoverlap(table.in, cex.par=cex.par) + table.in <- stopoverlap(table.in, cex.par=cex.par, xlim = xminmax, ylim = yminmax) classes <- classes[table.in[,4]] cex.par <- cex.par[table.in[,4]] } - make_afc_graph(table.in, classes, clnb, xlab, ylab, cex.txt = cex.par) + make_afc_graph(table.in, classes, clnb, xlab, ylab, cex.txt = cex.par, xminmax = xminmax, yminmax = yminmax) } else {