Change ggplot2 colourbar tick marks to black

前端 未结 3 776
花落未央
花落未央 2021-01-02 09:26

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

3条回答
  •  一整个雨季
    2021-01-02 10:17

    I usually find what I need to change by extensive use of str. I'm sure others can do it more elegantly.

    g <- ggplotGrob(p)
    g$grobs[[8]][[1]][[1]]$grobs[[5]]$gp$col <- "black"
    
    library(grid)
    grid.draw(g)
    

    enter image description here

提交回复
热议问题