From 7e12483392fe071f32bdd932f98491316ea8d8f4 Mon Sep 17 00:00:00 2001 From: yun Date: Thu, 18 Jul 2024 01:09:50 +0800 Subject: [PATCH] remove annotation strip text by default --- R/anno-.R | 4 ++++ R/gganno-.R | 3 ++- R/htanno-dendrogram.R | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/R/anno-.R b/R/anno-.R index 88999194..406ae83a 100644 --- a/R/anno-.R +++ b/R/anno-.R @@ -137,3 +137,7 @@ methods::setValidity("anno", function(object) { } TRUE }) + +anno_default_theme <- function() { + ggplot2::theme(strip.text = ggplot2::element_blank()) +} diff --git a/R/gganno-.R b/R/gganno-.R index 0d7834d1..40618348 100644 --- a/R/gganno-.R +++ b/R/gganno-.R @@ -18,7 +18,8 @@ gganno <- function(mapping = aes(), data = NULL, data = data, order = order, size = size, - plot = ggplot2::ggplot(mapping = mapping), + plot = ggplot2::ggplot(mapping = mapping) + + anno_default_theme(), name = name, position = position, set_context = set_context, labels = labels, labels_nudge = labels_nudge, call = call diff --git a/R/htanno-dendrogram.R b/R/htanno-dendrogram.R index 87c0c4f8..7dbe8c94 100644 --- a/R/htanno-dendrogram.R +++ b/R/htanno-dendrogram.R @@ -22,7 +22,8 @@ htanno_dendro <- function(mapping = aes(), ..., params = list( distance = distance, method = method, use_missing = use_missing, k = k, h = h, plot_cut_height = plot_cut_height, - plot = ggplot2::ggplot(mapping = mapping), + plot = ggplot2::ggplot(mapping = mapping) + + anno_default_theme(), segment_params = rlang::list2(...), center = center, type = type, root = root, # initialize height value