Permalink
Browse files

Add visual tests for stat_summary

  • Loading branch information...
1 parent deb4c50 commit c208e98b1ae6b79c7511ed53678a74946fd3d39c @wch wch committed Jan 24, 2013
Showing with 21 additions and 0 deletions.
  1. +21 −0 visual_test/stat-summary.r
@@ -0,0 +1,21 @@
+vcontext("stat-summary")
+
+ggplot(mtcars, aes(x = cyl, y = mpg, colour = factor(vs))) +
+ geom_point() +
+ stat_summary(fun.y = mean, geom="line", size = 2)
+save_vtest("summary with color and lines")
+
+# It is not possible to make this behave as expected without breaking the
+# summary with color and lines, because of the way grouping works with
+# stat_summary.
+ggplot(mtcars, aes(x = cyl, y = mpg)) +
+ geom_point() +
+ stat_summary(fun.data=mean_cl_boot, colour="red", geom="crossbar", width=0.2)
+save_vtest("summary with crossbars, no grouping (looks wrong)")
+
+ggplot(mtcars, aes(x = cyl, y = mpg, group = cyl)) +
+ geom_point() +
+ stat_summary(fun.data=mean_cl_boot, colour="red", geom="crossbar", width=0.2)
+save_vtest("summary with crossbars, manual grouping")
+
+end_vcontext()

0 comments on commit c208e98

Please sign in to comment.