From b8b50b09b2f8c833c076eea17ee4f59bc04d4e94 Mon Sep 17 00:00:00 2001 From: gnoblet Date: Mon, 29 May 2023 10:47:22 +0200 Subject: [PATCH] Simplify blank --- R/donut.R | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/R/donut.R b/R/donut.R index 3a75efb..0c1cd93 100644 --- a/R/donut.R +++ b/R/donut.R @@ -87,23 +87,21 @@ donut <- function(df, ggplot2::coord_polar( theta = "y" ) - if (hole_size >= 2) g <- g + ggplot2::xlim(c(1, hole_size + 0.5)) # Try to remove that to see how to make a pie chart - # No axis - g <- g + ggplot2::theme( - axis.line.x = ggplot2::element_blank(), - axis.ticks.x = ggplot2::element_blank(), - axis.text.x = ggplot2::element_blank(), - axis.title.x = ggplot2::element_blank(), - axis.line.y = ggplot2::element_blank(), - axis.ticks.y = ggplot2::element_blank(), - axis.text.y = ggplot2::element_blank(), - axis.title.y = ggplot2::element_blank() - ) + if (hole_size >= 2) g <- g + ggplot2::xlim(c(1, hole_size + 0.5)) # Try to remove that to see how to make a pie chart # Add theme g <- g + theme + # No axis + g <- g + ggplot2::theme( + axis.text = ggplot2::element_blank(), + axis.line = ggplot2::element_blank(), + axis.ticks = ggplot2::element_blank(), + axis.title = ggplot2::element_blank() + ) + + return(g) }