Skip to content

Commit 314a6ec

Browse files
committed
explicit theme_grey and fill=NA for readable ggplot
1 parent 5c98619 commit 314a6ec

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tests/testthat/test-ggplot-area.R

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ context("Area")
33
huron <- data.frame(year=1875:1972, level=as.vector(LakeHuron))
44
huron$decade <- plyr::round_any(huron$year, 10, floor)
55

6-
ar <- ggplot(huron) + geom_area(aes(x=year, y=level))
6+
ar <- ggplot(huron) +
7+
theme_grey()+
8+
geom_area(aes(x=year, y=level))
79
L <- gg2list(ar)
810

911
test_that("sanity check for geom_area", {
@@ -17,7 +19,9 @@ test_that("sanity check for geom_area", {
1719
save_outputs(ar, "area")
1820

1921
# Test alpha transparency in fill color
20-
gg <- ggplot(huron) + geom_area(aes(x=year, y=level), alpha=0.4)
22+
gg <- ggplot(huron) +
23+
theme_grey()+
24+
geom_area(aes(x=year, y=level), alpha=0.4)
2125
L <- gg2list(gg)
2226

2327
test_that("transparency alpha in geom_area is converted", {

tests/testthat/test-ggplot-theme.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ test_that("plot panel border is translated correctly", {
8888
save_outputs(ggiris, "theme-panel-border-1")
8989

9090
red <- ggplot(iris) +
91+
theme_grey()+
9192
geom_point(aes(Petal.Width, Sepal.Width)) +
92-
theme(panel.border=element_rect(colour="red"))
93+
theme(panel.border=element_rect(colour="red", fill=NA))
9394
info <- gg2list(red)
9495
for (xy in c("x", "y")) {
9596
ax.list <- info$kwargs$layout[[paste0(xy, "axis")]]

0 commit comments

Comments
 (0)