+
+color.gradient <- scales::seq_gradient_pal("yellow", "magenta", "Lab")(seq(0,1,length.out=length(unique(d$num.present))))
+
+png("questions_absence_histogram_combined.png", units="px", width=800, height=600)
+
+ggplot(d) +
+ aes(x=as.factor(num.calls), fill=as.factor(num.present)) +
+ geom_bar(color="black") +
+ stat_count() +
+ scale_x_discrete("Number of questions asked") +
+ scale_y_continuous("Number of students") +
+ # scale_fill_brewer("Absences") +
+ scale_fill_manual("Absences", values=color.gradient) +
+ theme_bw()
+
+dev.off()
+
+png("questions_absenses_boxplots.png", units="px", width=800, height=600)
+
+ggplot(data=d) +
+ aes(x=as.factor(num.calls), y=num.present) +
+ geom_boxplot() +
+ scale_x_discrete("Number of questions asked") +
+ scale_y_continuous("Number of questions present")
+
+dev.off()
+