The code below should rotate and align the text labels on the x-axis, but for some reason it don\'t:
ggplot(res, aes(x=TOPIC,y=count), labs(x=NULL)) +
sca
You need to change the order of the layers, otherwise theme_bw
will override theme
:
ggplot(res, aes(x=TOPIC,y=count), labs(x=NULL)) +
scale_y_continuous(limits=c(0,130),expand=c(0,0)) +
scale_x_discrete("",labels=c("ANA"="Anatomy","BEH"="Behavior","BOUND"="Boundaries",
"CC"="Climate change","DIS"="Disease","EVO"="Evolution",
"POPSTAT"="Pop status","POPABU"="Pop abundance",
"POPTR"="Pop trend","HARV"="Harvest","HAB"="Habitat",
"HABP"="Habitat protection","POLL"="Pollution",
"ZOO"="Captivity","SHIP"="Shipping","TOUR"="Tourism",
"REPEC"="Reprod ecology","PHYS"="Physiology","TEK"="TEK",
"HWC"="HWC","PRED"="Predator-prey","METH"="Methods",
"POPGEN"="Pop genetics","RESIMP"="Research impact",
"ISSUE"="Other","PROT"="Protection","PA"="Protected areas",
"PEFF"="Protection efficiency","MINOR"="Minor")) +
theme_bw(base_size = 16) +
theme(axis.text.x=element_text(angle=90,hjust=1)) +
geom_bar(stat='identity') +
ggtitle("Peer-reviewed papers per topic")