Generation

generate functionThu, 20 Apr 2023

colors <- c("#F8766D", "#7CAE00", "#00BFC4", "#C77CFF") library(ggplot2) ggplot(df, aes(x = categorical_FOD_FODs, y = Frequency, fill = Condition_FODs)) + geom_bar(stat = "identity", position = position_dodge()) + scale_fill_manual(values = colors, labels = c("Verbal", "Vm", "Manual", "Mv")) + labs( x = "FODs (direction)", y = "Frequency of FODs", title = "FODs values (ascending/descending) in four condition", fill = "Conditions (renamed)" ) + theme_minimal() + theme( plot.title = element_text(size = 14, face = "bold"), axis.title = element_text(size = 12, face = "bold"), axis.text = element_text(size = 10), legend.title = element_text(size = 10), legend.text = element_text(size = 10), panel.border = element_rect(color = "black", fill = NA, size = 1) ) I want you to improve this plot to show the result more clear than now. So please add error bars or confidence intervals to show the variability in the data.

# You can change the data to this df <- data.frame(categorical_FOD_FODs = rep(c("ascending", "descending"), each = 8), Condition_FODs = rep(c("Verbal", "Vm", "Manual", "Mv"), each = 2), Frequency = c(100.0, 98.4, 94.4, 97.7, 0.0, 1.6, 5.6, 2.3)) df

Questions about programming?Chat with your personal AI assistant