Erin-Rooney/XCT-freezethaw

Need fill and y-scale "free" for Connected vs Unconnected ggplot

Closed this issue · 2 comments

@kaizadp

I still need to figure out how to add fill to points. I tried to add fill into the geom_point aesthetics and got the following error:

image

Also, still need to change the y-axis scale for the unconnected figures.

ggplot(data = tool_long, aes(x = trmt, y = volume, color = sample)) +
geom_boxplot(aes(group = trmt), fill = "gray50", alpha = 0.2, width = 0.2) +
geom_path(aes(group = sample), size = 0.7)+
geom_point(size = 4, shape = 21, stroke = 1, color = "black") +
geom_text(data = gglabel, aes(x = trmt, y = volume, label = label), color = "black")+
facet_grid(connected ~ filltype, scales = "free_y")+
labs (title = "Connected Water-Filled Pores",
# caption = "Permafrost Soil Aggregate from Toolik, Alaska",
# tag = "A",
x = expression (bold (" ")),
y = expression (bold ("Volume, %"))) + scale_y_continuous(labels = scales::percent, limits = c(0, 0.09)) +
theme_er()

scales = "free_y" was not working because you had set y-limits in scale_y_continuous(). fixed.

for the fill issues -- I rearranged the aes() arguments: ggplot() has the first dataset and the x, y axes. then geom_point(), geom_boxplot(), geom_path() have their respective aesthetics for color/fill.

image

Oh awesome!!!! That all makes sense to me. And it looks really good. Thanks!