ggplot(data=arch,mapping=aes(x=level,y=score))+
geom_violin(color="gray30",fill="gray50",alpha=0.1,trim=FALSE)+
geom_jitter(width=0.1,color="black",alpha=0.25) +
stat_summary(fun.data=mean_cl_normal,geom="pointrange",
size=2,fatten=2,pch=3,color="red")+
scale_x_discrete(name="Class Standing") +
scale_y_continuous(name="Score",breaks=seq(0,300,50),
expand=expansion(mult=c(0,0.0))) +
theme_bw() +
theme(panel.grid.major.x=element_blank(),
axis.title.x=element_blank(),
axis.title.y=element_blank())+
labs(title="Distribution of Archery Scores",
subtitle="From Results of The 2018 Princeton Frozen Open ",
caption="Source: NASP tounament results")
NASP is an archery program in schools that’s hosts several archery tournaments trough out the year for people in grade school, middle school, and high school. At these tournaments archers shoot 30 arrows and can get a maximum score of 300. I was courious to see the distribution of scores that people got. I choose a violin plot becouse I thought it was a simple, visualy pleasing way to do this. I decided to group the plot by class stading so you could see the difference by age group. I found that everyone who compeates gets relitvly high scores. grade schoolers scores are generaly more variable and get lower than middle and high schoolers. I thought color in this plot was unesisary so I keept everthing on a grey scale. I added the points with jitter so you could see the actual data and I added a point range so you could easily see the mean score for each group. after adding a title I felt like the axis lables were redundent so I removed them.
ggplot(data=arch,mapping=aes(x=level,y=score))+
stat_summary(fun=mean,geom="bar",
fill="gray30",alpha=0.75)+
stat_summary(fun.data=mean_cl_normal,geom="errorbar",
width=0.1) +
facet_wrap(vars(gender))+
scale_x_discrete(name="Class Standing") +
scale_y_continuous(name="Mean Score",breaks=seq(0,300,50),
limits=c(0,300),expand=expansion(mult=c(0,0.0))) +
theme_bw() +
theme(panel.grid.major.x=element_blank(),
strip.background=element_rect(fill="black",color="gray50"),
strip.text=element_text(color="white",size=14,margin=margin(t=2,b=2,r=2,l=2),
face="bold"),
axis.title.x=element_blank(),
axis.title.y=element_blank())+
labs(title="Mean Archery Scores Amoung Class Standing And Gender",
subtitle="From Results of The 2018 Princeton Frozen Open ",
caption="Source: NASP tounament results")
The data are the same as in the first plot. For this plot I wanted to see if there was a difference between males and females. I decided to do a faceted bar plot because I thougt this would be the best way to show means split by 2 variables. again I thought color was unessisary so I kept it on a grey scale. I added error bars because I thought it was incompleat to show means without uncertanty. After adding the title the axis felt redundent so I removed them. The facest lables were ugly so I thined them out a bit, made the background black, and made the text bold.