diff --git a/cute_little_R_functions.R b/cute_little_R_functions.R index df125449432024ae138a7d61f4b9fcc4ee699ab1..b246e30790c4d16f31179eacb10034002b5842ae 100644 --- a/cute_little_R_functions.R +++ b/cute_little_R_functions.R @@ -9291,7 +9291,7 @@ assign(paste0(tempo.gg.name, tempo.gg.count <- tempo.gg.count + 1), ggplot2::coo # legend management if( ! is.null(legend.width)){ -legend.final <- fun_gg_get_legend(ggplot_built = final.plot, fun.name = function.name, lib.path = lib.path) # get legend +legend.final <- NULL # fun_gg_get_legend(ggplot_built = final.plot, fun.name = function.name, lib.path = lib.path) # get legend } # end legend management @@ -9376,8 +9376,6 @@ return(tempo <- output) - - # add return.ggplot = FALSE, from boxplot # add facet from boxplot if data1 is a dataframe or list of length 1 # error to fix: 1) accept integers as color, 2) fun_scale but xhuld be ok when importing the job from boxplot @@ -10586,13 +10584,13 @@ if(any(unlist(legend.disp))){ # means some TRUE tempo.graph.info <- ggplot2::ggplot_build(eval(parse(text = paste0(paste(paste0(tempo.gg.name, 1:tempo.gg.count), collapse = " + "), ' + ', tempo.legend.final)))) # will be recovered later again, when ylim will be considered legend.final <- fun_gg_get_legend(ggplot_built = tempo.graph.info, fun.name = function.name) # get legend fin.lg.disp[] <- FALSE # remove all the legends. Must be done even if fin.lg.disp is not appearing in the code thenafter. Otherwise twice the legend -if(is.null(legend.final)){ # even if any(unlist(legend.disp)) is TRUE +if(is.null(legend.final) & plot == TRUE){ # even if any(unlist(legend.disp)) is TRUE legend.final <- fun_gg_empty_graph() # empty graph instead of legend warn.count <- warn.count + 1 tempo.warn <- paste0("(", warn.count,") LEGEND REQUESTED (NON NULL categ ARGUMENT OR legend.show ARGUMENT SET TO TRUE)\nBUT IT SEEMS THAT THE PLOT HAS NO LEGEND -> EMPTY LEGEND SPACE CREATED BECAUSE OF THE NON NULL legend.width ARGUMENT\n") warn <- paste0(ifelse(is.null(warn), tempo.warn, paste0(warn, "\n\n", tempo.warn))) } -}else{ # means all FALSE +}else if(plot == TRUE){ # means all FALSE legend.final <- fun_gg_empty_graph() # empty graph instead of legend warn.count <- warn.count + 1 tempo.warn <- paste0("(", warn.count,") LEGEND REQUESTED (NON NULL categ ARGUMENT OR legend.show ARGUMENT SET TO TRUE)\nBUT IT SEEMS THAT THE PLOT HAS NO LEGEND -> EMPTY LEGEND SPACE CREATED BECAUSE OF THE NON NULL legend.width ARGUMENT\n") @@ -10778,4 +10776,3 @@ return(output) - diff --git a/fun_gg_boxplot.docx b/fun_gg_boxplot.docx index 7de3ad56c57ed638e90acce478c518b3339b06ba..67de1bb53fd5b8ef499252325c2509c4033ef4fa 100644 Binary files a/fun_gg_boxplot.docx and b/fun_gg_boxplot.docx differ diff --git a/scatter.docx b/scatter.docx index 23539aedfb0461176049cb4f252b8686749e5ae1..6072f1a8e6d762eac506a9ac551d6dd5270e75f5 100644 Binary files a/scatter.docx and b/scatter.docx differ