Skip to content

Commit

Permalink
feature #90: colorize interactive epoch plots
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntz committed Nov 25, 2024
1 parent d0c90de commit 6ad98de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/bidsify.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ bidsify <- function(eyeris, save_all = TRUE, epochs_list = NULL,
y_units <- "(a.u.)"
}

colors <- c("black", rainbow(length(pupil_steps) - 1))

y_label <- paste("pupil size", y_units)

file_out <- file.path(epochs_out, paste0(group, "_", pstep, ".png"))
Expand All @@ -305,8 +307,9 @@ bidsify <- function(eyeris, save_all = TRUE, epochs_list = NULL,
pointsize = 6
)
plot(group_df$timebin, group_df[[pupil_steps[pstep]]],
type = "l", xlab = "time (s)",
ylab = y_label, main = paste0(group, "\n", pupil_steps[pstep])
type = "l", xlab = "time (s)", ylab = y_label,
col = colors[pstep],
main = paste0(group, "\n", pupil_steps[pstep])
)
dev.off()
}
Expand Down

0 comments on commit 6ad98de

Please sign in to comment.