X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=PrintRScript.py;h=589aabf1c2f83b10f52643467643b1dd657e0d43;hp=686322ea6f6e12e72f93f467270e9f7f09b9c3be;hb=c11976803674091bd4e7ed4cbadeeebb5be67325;hpb=e47f8c20e356631980624eb52d8476b3b86917c5 diff --git a/PrintRScript.py b/PrintRScript.py index 686322e..589aabf 100644 --- a/PrintRScript.py +++ b/PrintRScript.py @@ -33,7 +33,7 @@ class PrintRScript : def sources(self, lsources) : for source in lsources : - self.add('source("%s")' % source) + self.add('source("%s", encoding = \'utf8\')' % source) def packages(self, lpks) : for pk in lpks : @@ -545,6 +545,7 @@ def barplot(table, rownames, colnames, rgraph, tmpgraph, intxt = False) : # height = 400 rownames = 'c("' + '","'.join(rownames) + '")' colnames = 'c("' + '","'.join(colnames) + '")' + if not intxt : #FIXME txt = """ @@ -1092,7 +1093,14 @@ class WordCloudRScript(PrintRScript) : self.packages(['wordcloud']) bg_col = Rcolor(self.parametres['col_bg']) txt_col = Rcolor(self.parametres['col_text']) + if self.parametres['svg'] : + svg = 'TRUE' + else : + svg = 'FALSE' txt = """ + svg <- %s + """ % svg + txt += """ act <- read.csv2("%s", header = FALSE, row.names=1, sep='\t') selected.col <- read.table("%s") toprint <- as.matrix(act[selected.col[,1] + 1,]) @@ -1102,7 +1110,7 @@ class WordCloudRScript(PrintRScript) : toprint <- as.matrix(toprint[order(toprint[,1], decreasing=TRUE),]) toprint <- as.matrix(toprint[1:maxword,]) } - open_file_graph("%s", width = %i, height = %i) + open_file_graph("%s", width = %i, height = %i , svg = svg) par(bg=rgb%s) wordcloud(row.names(toprint), toprint[,1], scale=c(%f,%f), random.order=FALSE, colors=rgb%s) dev.off()