I am trying to plot axis lines on my gpplot, but I keep getting an error. Would anyone know how to troubleshoot to:
- Plot x-axis line
- Plot y-axis line
# plot4 (regression coefficients)
p4 <- ggplot(df3, aes(x=reorder(topics,v1970), y=lm_coef)) +
geom_bar(stat='identity', aes(fill = cat)) +
labs(y = "\nYear Coefficients") +
theme(axis.title.y = element_blank(),
axis.text.y = element_blank(),
panel.background = element_rect(fill = NA),
axis.ticks.length.y = unit(.25, "cm"), # make ticks point outwards on y-axis
axis.ticks.length.x = unit(.25, "cm"), # make ticks point outwards on x-axis
axis.text.x = element_text(margin = margin(t = .3, unit = "cm")
)) +
#axis.line.x = element_line(linewidth = 0.1, colour = "black")
coord_flip()
show(p4)