I am attempting to adjust the position of the tick marks on my plot so they fall along the axis instead of on the perimeter of the plot (which is the default). I have tried using the axis.ticks
argument within ggplot2
and this did not work. Here are some example data and the code necessary to produce the graph I am working with:
library(ggplot2)
dat <- data.frame(v1 = c(1, 3, -2, 2, 1, 4, -2, 2),
v2 = c(-1, 2, 1, -3, 4, 1, -1, 2))
p = ggplot()
p + geom_point(aes(dat$v1, dat$v2) ,shape = 21, size = 3) +
geom_vline(xintercept = 0, linetype = "dashed") +
geom_hline(yintercept = 0, linetype = "dashed") +
theme_bw()
Please advise on any packages, functions, or arguments that can be used to move the tick marks onto the axises instead of the outside edges of the graphing area.