From d545cb337c40130fbf16cbcaf47887f3785527a8 Mon Sep 17 00:00:00 2001 From: akihirao Date: Thu, 2 May 2024 11:56:33 +0900 Subject: [PATCH 1/2] add option: site label angle --- R/func_structure_plot.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/func_structure_plot.R b/R/func_structure_plot.R index 552e34c..31fc29b 100644 --- a/R/func_structure_plot.R +++ b/R/func_structure_plot.R @@ -25,6 +25,7 @@ #' @param site_labels_size numeric value for site label size. #' @param site_labels_x numeric value for site label horizontal position. #' @param site_labels_y numeric value for site label vertical position. +#' @param site_labels_angle numeric value for rotating angle of site label. #' @param site_ticks show ticks when labels = "site". #' @param site_ticks_size numeric value for site tick size. #' @param flip_axis flip the axes so that the plot is vertical (TRUE or FALSE). @@ -50,6 +51,7 @@ structure_plot <- function(admixture_df, site_dividers = TRUE, divider_width = 1, divider_col = "white", divider_type = "dashed", site_order = NULL, site_labels_size = 2, site_labels_x = 0, site_labels_y = -0.025, + site_labels_angle = 0, site_ticks = TRUE, site_ticks_size = -0.01, facet_col = NULL, facet_row = NULL ) { @@ -161,7 +163,7 @@ structure_plot <- function(admixture_df, x = site_position+site_labels_x, y = rep(site_labels_y, length(site_position)), label = site_labels, label.size = NA, fill = NA, - vjust = 0, color = "black", size = site_labels_size, angle = 0 + vjust = 0, color = "black", size = site_labels_size, angle = site_labels_angle )+ ggplot2::theme( axis.text.x = ggplot2::element_blank(), From 485015842f9ebf6a4d61dc0fff0b3f01e7790cae Mon Sep 17 00:00:00 2001 From: Jenkins Date: Fri, 3 May 2024 09:46:43 +0100 Subject: [PATCH 2/2] Update structure_plot.Rd --- man/structure_plot.Rd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/man/structure_plot.Rd b/man/structure_plot.Rd index 86f212d..521dd33 100644 --- a/man/structure_plot.Rd +++ b/man/structure_plot.Rd @@ -21,6 +21,7 @@ structure_plot( site_labels_size = 2, site_labels_x = 0, site_labels_y = -0.025, + site_labels_angle = 0, site_ticks = TRUE, site_ticks_size = -0.01, facet_col = NULL, @@ -67,6 +68,8 @@ If \code{NULL}, sites are ordered alphabetically.} \item{site_labels_y}{numeric value for site label vertical position.} +\item{site_labels_angle}{numeric value for rotating angle of site label.} + \item{site_ticks}{show ticks when labels = "site".} \item{site_ticks_size}{numeric value for site tick size.}