Skip to content

Commit

Permalink
add hjust, angle, and size args to show_fibmatrix for x-axis text
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Jul 19, 2024
1 parent 9148081 commit 18951e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/show_fibmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#' @param asreact logical indicating if a \code{\link[reactable]{reactable}} object is returned
#' @param nrows if \code{asreact = TRUE}, a numeric specifying number of rows in the table
#' @param family optional chr string indicating font family for text labels
#' @param angle numeric for angle of x-axis text labels
#' @param hjust numeric for horizontal justification of x-axis text labels
#' @param size numeric for size of the x-axis text labels
#' @param plotly logical if matrix is created using plotly
#' @param width numeric for width of the plot in pixels, only applies of \code{plotly = TRUE}
#' @param height numeric for height of the plot in pixels, only applies of \code{plotly = TRUE}
Expand Down Expand Up @@ -40,8 +43,8 @@ show_fibmatrix <- function(fibdata, yrrng = NULL,
stas = NULL, indic = NULL, threshold = NULL, lagyr = 3,
subset_wetdry = c("all", "wet", "dry"), precipdata = NULL,
temporal_window = NULL, wet_threshold = NULL,
txtsz = 3, asreact = FALSE, nrows = 10, family = NA, plotly = FALSE,
width = NULL, height = NULL){
txtsz = 3, asreact = FALSE, nrows = 10, family = NA, angle = 90,
size = 10, hjust = 0, plotly = FALSE, width = NULL, height = NULL){

cols <- c('#2DC938', '#E9C318', '#EE7600', '#CC3231', '#800080')

Expand Down Expand Up @@ -102,7 +105,8 @@ show_fibmatrix <- function(fibdata, yrrng = NULL,
ggplot2::theme(
axis.title = ggplot2::element_blank(),
legend.position = 'none',
panel.grid = ggplot2::element_blank()
panel.grid = ggplot2::element_blank(),
axis.text.x = ggplot2::element_text(angle = angle, hjust = hjust, size = size)
)

if(!is.null(txtsz))
Expand Down
9 changes: 9 additions & 0 deletions man/show_fibmatrix.Rd

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

0 comments on commit 18951e9

Please sign in to comment.