In some of my plots I find it hard to see the tick marks in the colour bar. I haven't been able to find a documented way to change the colour of the ticks. All the examples seem to focus on changing the labels or not drawing ticks at all. Is it possible?
# Data
require(ggplot2)
require(grid)
n <- 100
x <- y <- seq(-4*pi, 4*pi, len=n)
r <- cos( sqrt( outer(x^2, y^2, "+") ) ^ 2 )
df <- data.frame( x = rep( x , each = n) , y = rep( y , times = n ) , val = c(r) )
# Plot
ggplot( df , aes( x , y , fill = val ) )+
geom_raster()+
scale_fill_gradient( low = "#FFFFFF" , high = "#de2d26" )+
guides( fill = guide_colourbar( barheight = unit( 3 , "in" ) ) )+
theme_bw()+
theme( line = element_line( colour = "#0000FF" ) )
How can I make the ticks in the colourbar be plotted in black rather than white, without changing other elements of the plot?
p.s. kudos to this question for the function to create the example data