Created
February 15, 2021 19:12
-
-
Save michaeldorman/48d8e3ad518891057a190aa3149c1e29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(wesanderson) | |
mean_steps <- read.csv("data.csv", stringsAsFactors = FALSE) | |
cols = c("#FF0000", "#00A08A", "#F2AD00") | |
cols2 = paste0(cols, "80") | |
cols = c(rbind(cols2, cols)) | |
ggplot(data=mean_steps,aes(x = trial, y = mean_same, color = paste(block, actor))) + | |
stat_summary(fun="mean",position=position_dodge(width=0.1), | |
geom="line" ,size=2) + | |
geom_hline(yintercept = 50,linetype="dashed", color = "grey",size=1)+ | |
scale_y_continuous(name="Percentage correct chosen (%)", breaks = seq(0, 100, 25)) + | |
scale_x_continuous(name="Trial", breaks = seq(0, 20, 4)) + | |
facet_wrap(.~block, strip.position="top")+ | |
scale_color_manual(values=cols) + | |
theme( | |
legend.title = element_blank(), | |
axis.title.x = element_text(size = 10, vjust = -0.35), | |
axis.title.y = element_text(size = 10, vjust = 0.5), | |
axis.text.x = element_text(size = 8, vjust = 0.5), | |
axis.text.y = element_text(size = 8, vjust = 0.5) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment