Skip to content
This repository
Browse code

Add visual tests for stat_summary

  • Loading branch information...
commit c208e98b1ae6b79c7511ed53678a74946fd3d39c 1 parent deb4c50
Winston Chang wch authored

Showing 1 changed file with 21 additions and 0 deletions. Show diff stats Hide diff stats

  1. +21 0 visual_test/stat-summary.r
21 visual_test/stat-summary.r
... ... @@ -0,0 +1,21 @@
  1 +vcontext("stat-summary")
  2 +
  3 +ggplot(mtcars, aes(x = cyl, y = mpg, colour = factor(vs))) +
  4 + geom_point() +
  5 + stat_summary(fun.y = mean, geom="line", size = 2)
  6 +save_vtest("summary with color and lines")
  7 +
  8 +# It is not possible to make this behave as expected without breaking the
  9 +# summary with color and lines, because of the way grouping works with
  10 +# stat_summary.
  11 +ggplot(mtcars, aes(x = cyl, y = mpg)) +
  12 + geom_point() +
  13 + stat_summary(fun.data=mean_cl_boot, colour="red", geom="crossbar", width=0.2)
  14 +save_vtest("summary with crossbars, no grouping (looks wrong)")
  15 +
  16 +ggplot(mtcars, aes(x = cyl, y = mpg, group = cyl)) +
  17 + geom_point() +
  18 + stat_summary(fun.data=mean_cl_boot, colour="red", geom="crossbar", width=0.2)
  19 +save_vtest("summary with crossbars, manual grouping")
  20 +
  21 +end_vcontext()

0 comments on commit c208e98

Please sign in to comment.
Something went wrong with that request. Please try again.