File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
context(" Density2d" )
2
2
3
3
# Draw a 2d density estimation using geom_density2d
4
- m <- ggplot(MASS :: geyser ) + geom_density2d(aes(x = duration , y = waiting ))
4
+ m <- ggplot(MASS :: geyser , aes(x = duration , y = waiting )) +
5
+ geom_point(alpha = 0.4 ) +
6
+ geom_density2d()
5
7
L <- save_outputs(m , " density2d" )
6
8
7
9
test_that(" geom_density2d is translated to type=histogram2dcontour" , {
8
- expect_equal(length(L $ data ), 1 )
9
- expect_identical(L $ data [[1 ]]$ type , " histogram2dcontour" )
10
+ expect_equal(length(L $ data ), 2 )
11
+ expect_identical(L $ data [[2 ]]$ type , " histogram2dcontour" )
10
12
})
11
13
12
14
test_that(" geom_density2d uses line contours by default" , {
13
- expect_identical(L $ data [[1 ]]$ contours $ coloring , " lines" )
15
+ expect_identical(L $ data [[2 ]]$ contours $ coloring , " lines" )
14
16
})
You can’t perform that action at this time.
0 commit comments