Skip to content

Commit

Permalink
Added linewidth argument to structure_plot_ggplot_call() as a tempora…
Browse files Browse the repository at this point in the history
…ry fix for Issue #60.
  • Loading branch information
pcarbo committed Jan 29, 2025
1 parent 95228b2 commit 1551358
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 6 additions & 5 deletions R/structure_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) +
Expand Down
11 changes: 10 additions & 1 deletion man/structure_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1551358

Please sign in to comment.