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 get the colour codes (e.g., #....... )of used exactly in this plot?

get_colours <- function(ggplot2_object){ ggplot2_object + theme(panel.background = element_rect(fill = NA)) + theme(panel.grid.major = element_blank()) + theme(panel.grid.minor = element_blank()) + theme(panel.border = element_rect(fill = NA)) + theme(axis.line = element_blank()) + theme(axis.text.x = element_blank()) + theme(axis.text.y = element_blank()) + theme(axis.ticks = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.title.y = element_blank()) + theme(plot.background = element_blank()) + theme(plot.title = element_blank()) + theme(legend.position = "none") + theme(legend.background = element_blank()) + theme(legend.key = element_blank()) + theme(legend

Questions about programming?Chat with your personal AI assistant