简体   繁体   中英

ggplot does not process theme_bw()

I am trying to make a histogram of brain activation across two different conditions, and I have the main plot working. However, I would like to change the orientation of the labels of the x-axis, as well as the legend labels and the font.. All of these pass through the theme() argument, but for some reason, my plot does not seem to take them in to account.

     x = colnames(data[,c(3:8,12:21)])
     y1 = meand3h
     y2 = meand5h

     to_plot <- data.frame(x=x,y1=y1,y2=y2) 
     melted<-melt(to_plot, id="x")


     p<-ggplot(melted,aes(x=x,y=value,fill=variable))

     p
     + scale_shape_discrete(name="Group",labels=c("Three days","Five days")) 
     + geom_bar(stat="identity", alpha=1) 
     + labs(y = "Level of Activation")
     + labs(title = "Activation of Brain Areas After Training")    
     + theme_bw(base_size = 12, base_family = "Times") 
     + theme(axis.title.x = element_text(angle=180))

Can anyone help me fix this?

这是因为您有两个引起对比的主题,请在 theme() 和 theme_bw() 之间进行选择。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM