Commit 0e9c7c3b authored by Carine Rey's avatar Carine Rey
Browse files

improve plot

parent 592fee23
......@@ -542,6 +542,9 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
tmp_df[dim(tmp_df)[1]+1,] = tmp_df[dim(tmp_df)[1],]
tmp_df$couple[dim(tmp_df)[1]] = "to_be_rm2"
}
from_m=c("PCOC","Mutinomial_1MinusLRT", "Msd_0.05_1MinusP", "Identical_LG08", "Tdg09_1MinusLRT","Topological_LG08","diffsel_mean")
to_m=c("PCOC","Mutinomial", "msd", "Identical", "TDG09","Topological","diffsel")
tmp_df$methode = mapvalues(tmp_df$methode, from=from_m, to=to_m)
plot = ggplot(tmp_df, aes(x=sensitivity, y=precision98_02, col = methode))
plot = plot + theme_bw()
plot = plot + labs(x="Sensitivity (= Recall)", y="Precision")
......@@ -559,6 +562,7 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
from_r=c(1,2,3,4,5,6,7,8,9)
to_y = 0.8 - 0.1 * from_r
df_auc_label$y = mapvalues(df_auc_label$auc2_rank, from=from_r, to=to_y)
df_auc_label$methode = mapvalues(df_auc_label$methode, from=from_m, to=to_m)
df_auc_label$label = substr(as.character(df_auc_label$auc2), 1,5)
df_auc_leg = data.frame(couple = unique(tmp_df$couple), x = 0.9, y = 0.8, label = "AUC ")
plot = plot + geom_label(data=df_auc_label, aes(x=0.9, y=y, label=label, col=methode))
......@@ -580,19 +584,29 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
legend.title = element_text(size=0),
legend.background = element_rect(fill="white", size=0.5, linetype="solid",
colour ="black")) +
guides( colour = guide_legend(override.aes = list(alpha = 1,size = 3), nrow=2))
guides( colour = guide_legend(override.aes = list(alpha = 1,size = 3), nrow=1))
)
plot_recall_precision_papier_ok = plot_grid(legend_PR,
plot1 + theme(legend.position="none"),
NULL,
plot2 + theme(legend.position="none"),
NULL,
plot3 + theme(legend.position="none"),
NULL,
plot4 + theme(legend.position="none"),
ncol = 1, scale = 1,
labels = c("","Only Pressure Shift","Only Change in Selection Efficacy","Pressure Shift in a context of global change of Selection Efficacy","Pressure Shift+CSE"),
labels = c("",
"Only Pressure Shift",
"",
"Only Change in Selection Efficacy",
"",
"Pressure Shift in a context of global change of Selection Efficacy",
"",
"Pressure Shift+CSE"),
align = "h",
rel_heights = c( 0.1, 0.7,0.7,0.7,0.7),
rel_heights = c( 0.2, 0.7,0.05,0.7,0.05,0.7,0.05,0.7),
hjust = 0, vjust = 0)
......@@ -600,7 +614,7 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
save_plot(paste0(opt$out,suffix,".recall_precision_ok.pdf"),
plot_recall_precision_papier_ok,
ncol = 2.5,
nrow = 4.2,
nrow = 4,
base_aspect_ratio = 1,
limitsize = FALSE
)
......
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