diff --git a/DESCRIPTION b/DESCRIPTION index b8f40a0..87774f9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Encoding: UTF-8 Type: Package Package: fastTopics -Version: 0.7-03 +Version: 0.7-05 Date: 2024-01-29 Title: Fast Algorithms for Fitting Topic Models and Non-Negative Matrix Factorizations to Count Data diff --git a/R/structure_plot.R b/R/structure_plot.R index fa44f54..e5872c0 100644 --- a/R/structure_plot.R +++ b/R/structure_plot.R @@ -328,6 +328,9 @@ plot.multinom_topic_model_fit <- function (x, ...) #' \code{ticks = NULL}. #' #' @param font.size Font size used in plot. +#' +#' @param linewidth Passed as the \dQuote{linewidth} argument to +#' \code{\link[ggplot2]{geom_col}}. #' #' @importFrom ggplot2 ggplot #' @importFrom ggplot2 aes_string @@ -344,13 +347,11 @@ plot.multinom_topic_model_fit <- function (x, ...) #' @export #' structure_plot_ggplot_call <- function (dat, colors, ticks = NULL, - font.size = 9) - ggplot(dat,aes_string(x = "sample",y = "prop",color = "topic", - fill = "topic")) + - geom_col() + + font.size = 9, linewidth = 0) + ggplot(dat,aes_string(x = "sample",y = "prop",fill = "topic")) + + geom_col(linewidth = linewidth) + scale_x_continuous(limits = c(0,max(dat$sample) + 1),breaks = ticks, labels = names(ticks)) + - scale_color_manual(values = colors) + scale_fill_manual(values = colors) + labs(x = "",y = "topic proportion") + theme_cowplot(font.size) + diff --git a/man/structure_plot.Rd b/man/structure_plot.Rd index 551a937..ca807ed 100644 --- a/man/structure_plot.Rd +++ b/man/structure_plot.Rd @@ -27,7 +27,13 @@ structure_plot_default_embed_method(fit, ...) \method{plot}{multinom_topic_model_fit}(x, ...) -structure_plot_ggplot_call(dat, colors, ticks = NULL, font.size = 9) +structure_plot_ggplot_call( + dat, + colors, + ticks = NULL, + font.size = 9, + linewidth = 0 +) } \arguments{ \item{fit}{An object of class \dQuote{poisson_nmf_fit} or @@ -110,6 +116,9 @@ axis, and their names. For data that are not grouped, use \code{ticks = NULL}.} \item{font.size}{Font size used in plot.} + +\item{linewidth}{Passed as the \dQuote{linewidth} argument to +\code{\link[ggplot2]{geom_col}}.} } \value{ A \code{ggplot} object.