I am trying to make a barplot where the bars would have the color "dodgerblue4" as a gradient. I tried to use scale_color_gradient but it didn't work. I would like the highest value to have "dodgerblue4" and have that color fading, is it possible? Thank you! My code for now is:
Fields<-c("Oceanography","Meteorology \n atmospheric \n Science",
"Physical sciences \n other topics","Environmental \n sciences \n ecology",
"Geography","Marine \n freshwater \n biology","Mathematics","Geology",
"Zoology", "Geochemestry \n and Geophysics")
n_art<-c(3178,3166,2919,1975,1963,1900,1027,1015,892,840)
n_field<-c(1,2,3,4,5,6,7,8,9,10)
df_wos<- data.frame(n_art,Fields,n_field)
df_wos$Fields<-factor(df_wos$Fields,
levels = df_wos$Fields[order(df_wos$n_art,decreasing = TRUE)])
ggplot(df_wos) +
aes(x = Fields, weight = n_art) +
geom_bar(fill = "dodgerblue4")+
scale_fill_hue() +
labs(x=NULL, y = "Number of papers") +
theme_bw()+
theme(panel.border = element_blank(), panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black"))


