Skip to content

Commit

Permalink
Use grDevices::palette.colors() where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Jul 6, 2024
1 parent e87387a commit b30bc87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions R/aggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ aggplot <- function(rspecdata, by = NULL, FUN.center = mean, FUN.error = sd,
lcol <- rep(lcol, ncol(cntplotspecs))
}

col_list <- c(
"#E41A1C", "#377EB8", "#4DAF4A", "#984EA3",
"#FF7F00", "#FFFF33", "#A65628", "#F781BF"
col_list <- grDevices::palette.colors(
ncol(cntplotspecs),
palette = "Okabe-Ito",
alpha = 1,
recycle = TRUE
)

col_list <- rep_len(col_list, dim(cntplotspecs)[2])
Expand Down
9 changes: 5 additions & 4 deletions R/plotsmooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ plotsmooth <- function(rspecdata, minsmooth = 0.05, maxsmooth = 0.20,

par(mar = c(2, 2, 2, 2), oma = c(3, 3, 0, 0))

col_list <- c(
"#000000", "#E41A1C", "#377EB8", "#4DAF4A", "#984EA3",
"#FF7F00", "#ffdd33", "#A65628", "#F781BF"
cols <- grDevices::palette.colors(
n = length(curves),
palette = "Okabe-Ito",
alpha = 1,
recycle = TRUE
)
cols <- col_list[seq_len(curves)]

# Creates the smooth data matrix
for (i in seq_len(nplots)) {
Expand Down

0 comments on commit b30bc87

Please sign in to comment.