## scale_fill_gradient worked for me, though the gradient is limited, for me it only showed 3 colors
fit <- plot(barplot(GO_results_BP,showCategory = 10)+ scale_fill_gradient(low = "black", high = "lightgrey"))
## Another related option is scale_fill_gradientn, then you can set a specific palette
fit <- plot(barplot(GO_results_BP,showCategory = 10)+ scale_fill_gradientn(colours = gray.colors(10)))
• 0 views
•
link
As an update, I tried to do the plot directly through ggplot, like this :
But I get the following error :
I'm trying to color the bars of the plot according to the adjusted p-value, but it's a continuous coloring and not a discrete one, any way to fix this ?
Many thanks