Q:

Can ggplot change the direction of axis.ticks from downward to upward?

Something I want to realize is like the following:

You see the direction of the axis.ticks is upward.
So can ggplot make the direction of axis.ticks  upward?
For now I can realize this

You can see the axis.ticks.length have been set to zero with the command of Axis Attributes · hadley/ggplot2 Wiki · GitHub
But this is not what I want and there seems little description of it online. 
Thank you!

A:

I think this achieves your goal:
library(ggplot2)
library(grid)

gg <- ggplot(mtcars, aes(mpg, drat))
gg <- gg + geom_point(size=3)
gg <- gg + theme_bw()
gg <- gg + theme(axis.text.x=element_text(size=17, vjust=-0.25, color="black"))
gg <- gg + theme(axis.text.y=element_text(size=17, hjust=1, color="black"))
gg <- gg + theme(axis.ticks=element_line(color="black", size=0.5))
gg <- gg + theme(axis.ticks.length=unit(-0.25, "cm"))
gg <- gg + theme(axis.ticks.margin=unit(0.5, "cm"))
gg

We're just modifying the tick size and "reversing" the length then making sure the tick labels are positioned properly after that.

