I am trying to create a dotplot in ggplot, were the scale colour represents the p-value of the data set, but it is not behaving as I expect. The max and min limits of this scale colour are so far in units (from 0.04 to 8e-17). So it is only showing from 0.04 to 0.005 and every dot with lower p-value will have the same colour as 0.005.
I tried this, but the plot still doesn't adjust to the manual limits: A dotplot from my data here:
myPalette <- colorRampPalette(c("red", "blue"))
sc <- scale_colour_gradientn(colours = myPalette(100), limits=c(min(data$`p-value`),max(data$`p-value`)), n.breaks = 10)
p + sc
Is there a max distance that can exist between max and min in the limits for scale_colour_gradientn ? Should I use another way to create the scale ? How can I solve this ?
Thanks in advance, Miriam