I am making a fairly complicated ggplot that consists of a time-series plot based on the left y axis over a double bar graph based on the right y axis. The plot looks good, but the legend denotes the colors of the different lines and bars with a solid black box that has that object's color around the margins of the black box. Is there any way to make the box the solid color instead of just an outline?
Here is my plot:
fullPlot<- ggplot() +
geom_point(data = df,aes(x=datetime,y=VWC,color = Legend)) +
geom_col(data = df, aes(x = datetime, y = cm/ab, color = Legend), width=1) +
scale_color_discrete(name = "Legend", labels = c("Irrigation (cm)", "Precipitation (cm)", "Deep (30-60 cm)", "Shallow (0-30 cm)")) +
theme(plot.title = element_text(hjust = 0.5)) +
xlab("Date") +
ylab("Volumetric Water Conent") +
facet_wrap(~Treatment, nrow = 5, ncol = 1) +
scale_x_datetime(breaks = date_breaks("2 days"), date_labels = "%b %d") +
scale_y_continuous(sec.axis = sec_axis(~. *ab)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
Because it is based on two large datasets, I'm not sure if it would be helpful to include the data. If anyone would like that, I can add that in as well.
Please let me know if you have any solutions or if I should change my formatting here in any way. Thanks!