Entering edit mode
3.1 years ago
vHelmholtz
▴
40
Hi all,
I want to reverse the color scale of my dot plot below - the higher 'NES' score is darker, the lower 'NES' score is brighter. Could you help me with this issue?
Thanks in advance!
Joshua
library(ggplot2)
library(forcats)
data <-read.csv("C:/.../Dot plot.csv", fileEncoding = 'UTF-8-BOM')
Fig <- ggplot(data,aes(x = Groups, y = reorder(Pathways, +Order), size = nlogFDR, color = NES)) +
geom_point(alpha = 0.8) +
scale_size(range = c(3, 13), name="-log10(FDR)") +
guides(color = guide_colorbar(reverse = FALSE)) +
theme_classic()
Fig
try adding
scale_color_continuous(trans='reverse')
after geom_point and before scale_sizeThat works! Thank you!
-Joshua