Skip to content
Snippets Groups Projects
Commit 37c29f73 authored by Arnaud Duvermy's avatar Arnaud Duvermy
Browse files

coord_fixed

Former-commit-id: 2399c691da97853016d58199537d5fcfa2a01abc
Former-commit-id: fc8f2aabe57e467786f58ea148410a5ccc961a71
Former-commit-id: d0fa8a56710786744eb88353cf5fe0624b2cefce
parent 6676f52a
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ eval_identityTerm <- function(data_identity, palette_color = c(DESeq2 = "#500472
ggplot2::ggtitle("Identity plot") +
ggplot2::scale_color_manual(values = palette_color ) +
ggplot2::scale_shape_manual(values = palette_shape )
p$plot_env <- rlang::new_environment()
obj_idTerm <- list(R2 = data_metrics, p = p )
......
......@@ -99,7 +99,7 @@ get_pr_object <- function(evaldata_params, col_param = "description", col_truth
#' @param palette_color list of colors used.
#' @param ... Additional arguments to be passed to \code{ggplot2::geom_path}.
#' @return A ggplot object representing the precision-recall curve.
#' @importFrom ggplot2 ggplot geom_path geom_text theme_bw xlim ylim scale_color_manual aes sym
#' @importFrom ggplot2 ggplot geom_path geom_text theme_bw coord_fixed scale_color_manual aes sym
#' @export
build_gg_pr_curve <- function(data_curve, data_auc, palette_color = c("#500472", "#79cbb8"), ...){
......@@ -118,8 +118,7 @@ build_gg_pr_curve <- function(data_curve, data_auc, palette_color = c("#500472",
label = paste("AUC :", round(pr_AUC, 2) , sep = ""), col = from )
) +
ggplot2::theme_bw() +
ggplot2::xlim( 0, 1 ) +
ggplot2::ylim( 0, 1 ) +
ggplot2::coord_fixed() +
ggplot2::scale_color_manual(values = palette_color)
}
......@@ -133,7 +132,7 @@ build_gg_pr_curve <- function(data_curve, data_auc, palette_color = c("#500472",
#' @param pr_obj precision-recall object.
#' @param ... Additional arguments to be passed to \code{ggplot2::geom_path}.
#' @return precision-recall curves and AUCs for both aggregated and individual parameters.
#' @importFrom ggplot2 facet_wrap coord_fixed
#' @importFrom ggplot2 facet_wrap
#' @export
get_pr_curve <- function(pr_obj, ...){
......@@ -146,8 +145,7 @@ get_pr_curve <- function(pr_obj, ...){
data_curve <- pr_obj$byparams$pr_curve
data_auc <- pr_obj$byparams$pr_auc
pr_obj$byparams$pr_curve <- build_gg_pr_curve(data_curve, data_auc, col = from , ... ) +
ggplot2::facet_wrap(~description) +
ggplot2::coord_fixed()
ggplot2::facet_wrap(~description)
return(pr_obj)
}
......
......@@ -124,6 +124,8 @@ get_roc_object <- function(evaldata_params, col_param = "description", col_truth
#' @param palette_color List of colors used.
#' @param ... Additional arguments to be passed to ggplot2::geom_path.
#' @return A ggplot object representing the ROC curve.
#' @importFrom ggplot2 ggplot geom_path geom_text theme_bw coord_fixed scale_color_manual aes
#' @export
build_gg_roc_curve <- function(data_curve, data_auc, palette_color = c("#500472", "#79cbb8") , ...){
......@@ -137,8 +139,7 @@ build_gg_roc_curve <- function(data_curve, data_auc, palette_color = c("#500472"
label = paste("AUC :", round(roc_AUC, 2) , sep = ""), col = from)
) +
ggplot2::theme_bw() +
ggplot2::xlim( 0, 1 ) +
ggplot2::ylim( 0, 1 ) +
ggplot2::coord_fixed() +
ggplot2::scale_color_manual(values = palette_color)
}
......@@ -171,6 +172,7 @@ get_label_y_position <- function(data_auc){
#' @param roc_obj ROC object.
#' @param ... Additional arguments to be passed to \code{ggplot2::geom_path}.
#' @return ROC curves and AUCs for both aggregated and individual parameters.
#' @importFrom ggplot2 facet_wrap
#' @export
get_roc_curve <- function(roc_obj, ...){
......@@ -183,8 +185,7 @@ get_roc_curve <- function(roc_obj, ...){
data_curve <- roc_obj$byparams$roc_curve
data_auc <- roc_obj$byparams$roc_auc
roc_obj$byparams$roc_curve <- build_gg_roc_curve(data_curve, data_auc, col = from, ... ) +
ggplot2::facet_wrap(~description) +
ggplot2::coord_fixed()
ggplot2::facet_wrap(~description)
return(roc_obj)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment