From 0b0101a503b89134ebbd69622dab54826c324a7b Mon Sep 17 00:00:00 2001 From: "louis.heraut" <louis.heraut@inrae.fr> Date: Tue, 21 Dec 2021 11:56:58 +0100 Subject: [PATCH] Aes layout --- plotting/panel.R | 9 +++++++-- script.R | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/plotting/panel.R b/plotting/panel.R index 2183d16..76ed6a6 100644 --- a/plotting/panel.R +++ b/plotting/panel.R @@ -1375,7 +1375,7 @@ matrice_panel = function (list_df2plot, df_meta, trend_period, mean_period, slic code = subCode[k] name = df_meta[df_meta$code == code,]$nom - ncharMax = 40 + ncharMax = 38 if (nchar(name) > ncharMax) { name = paste(substr(name, 1, ncharMax), '...', sep='') } @@ -1619,7 +1619,7 @@ map_panel = function (list_df2plot, df_meta, df_shapefile, idPer=1, outdirTmp='' ymin = gpct(5, ylim, shift=TRUE) ymax = ymin + gpct(1, ylim) size = 3 - sizekm = 3 + sizekm = 2.5 } else { xmin = gpct(5, xlim, shift=TRUE) xint = c(0, 100*1E3) @@ -1667,6 +1667,7 @@ map_panel = function (list_df2plot, df_meta, df_shapefile, idPer=1, outdirTmp='' fill = c() shape = c() trend = c() + p_threshold_Ok = c() for (code in Code) { @@ -1734,6 +1735,8 @@ map_panel = function (list_df2plot, df_meta, df_shapefile, idPer=1, outdirTmp='' fill = c(fill, filltmp) shape = c(shape, shapetmp) trend = c(trend, trendMean) + p_threshold_Ok = c(p_threshold_Ok, + df_trend_code_per$p <= p_threshold) } @@ -1872,6 +1875,8 @@ map_panel = function (list_df2plot, df_meta, df_shapefile, idPer=1, outdirTmp='' yTrend = (trend - minTrendMean[idPer, i]) / (maxTrendMean[idPer, i] - minTrendMean[idPer, i]) * valNorm + + yTrend = yTrend[p_threshold_Ok] xTrend = rnorm(length(yTrend), mean=1.75, sd=0.1) plot_trend = tibble(xTrend=xTrend, yTrend=yTrend) diff --git a/script.R b/script.R index 4e0a9ae..8bfe70f 100644 --- a/script.R +++ b/script.R @@ -22,7 +22,7 @@ filedir = ### MANUAL SELECTION ### # Name of the file that will be analysed from the AG directory filename = - # "" + "" # c( # "S2235610_HYDRO_QJM.txt", @@ -32,9 +32,9 @@ filename = # "Q7002910_HYDRO_QJM.txt" # ) - c("S4214010_HYDRO_QJM.txt", - "O0384010_HYDRO_QJM.txt", - "Q7002910_HYDRO_QJM.txt") + # c("S4214010_HYDRO_QJM.txt", + # "O0384010_HYDRO_QJM.txt", + # "Q7002910_HYDRO_QJM.txt") @@ -44,8 +44,8 @@ AGlistdir = "" AGlistname = - "" - # "Liste-station_RRSE.docx" + # "" + "Liste-station_RRSE.docx" ### NIVALE SELECTION ### @@ -235,13 +235,13 @@ res_VCN10trend = get_VCN10trend(df_data, df_meta, # filename_opt='time') -# df_shapefile = ini_shapefile(computer_data_path, fr_shpdir, fr_shpname, bs_shpdir, bs_shpname, rv_shpdir, rv_shpname, riv=FALSE) +df_shapefile = ini_shapefile(computer_data_path, fr_shpdir, fr_shpname, bs_shpdir, bs_shpname, rv_shpdir, rv_shpname, riv=TRUE) panels_layout(isplot=c( - 'datasheet' - # 'matrix' - # 'map' + 'datasheet', + 'matrix', + 'map' ), df_data=list(res_QAtrend$data, res_QMNAtrend$data, res_VCN10trend$data), -- GitLab