how to remove that white line from a ggplot2 colourbar?
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
scale_fill_gradientn(colours = terrain.colors(10))+
theme(legend.key.height=unit(2,"line"))
generates this plot

But if you zoom in the legend, you will see tiny annoying white lines:

How can I remove them? Thanks
You can set the ticks.colour= within guide_colorbar() by referencing via guides()... here ya go:
# where "plot" = your plot code...
plot + guides(fill=guide_colorbar(ticks.colour = "black"))

And to remove them, set the color to NA:
plot + guides(fill=guide_colorbar(ticks.colour = NA))

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With