Generation

generate functionTue, 18 Apr 2023

library(ggplot2) avfourfods <- ggplot(meanFODs_indvar_FODs, aes(x = Condition_FODs, y = mean, fill = Condition_FODs)) + geom_bar(stat = "identity", position = "dodge") + geom_errorbar(aes(ymin = mean - sd/sqrt(count), ymax = mean + sd/sqrt(count)), width = 0.2, position = position_dodge(width = 0.9)) + xlab("Condition") + ylab("Mean of FODs") + ggtitle("Average of first order differences (FODs): Four conditions") + theme_minimal() + theme(panel.border = element_rect(color = "black", fill = NA, size = 1)) + labs(fill = "Conditions") + geom_hline(yintercept = 0, color = "black", linetype = "solid", size = 2) how can I learn the colour codes (e.g., #....... ) used exactly in this plot? I need to remember the colour codes to use in another script

# get the colour codes used in ggplot ggplot2::ggplot_build(avfourfods)$data[[1]]$colour # get the colour codes in the same order to use in other places avfourfods <- avfourfods + scale_fill_manual(values=c("#CC3333", "#3366FF", "#FF9900", "#33CC33"))

Questions about programming?Chat with your personal AI assistant