Skip to content

Commit c208e98

Browse files
committed
Add visual tests for stat_summary
1 parent deb4c50 commit c208e98

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

visual_test/stat-summary.r

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)