2016-11-10 10 views
1

なぜ次のコードでは、fivethirtyeightテーマのように色が変わらないのですか?theme_fivethirtyeight()は棒グラフの色を変更しません

ggplot(df.long, aes(ROIs, Mean, fill=Methods))+ 
geom_bar(stat="identity",position="dodge", width=0.75)+ 
    theme_fivethirtyeight()+ 
    scale_color_fivethirtyeight()+ 
theme(axis.text.x=element_text(angle=20,hjust=1,vjust=1, face="bold", size=9), 
     axis.text =element_text(face="bold"), 
     axis.title= element_text(face="bold"), 
     legend.position=c(1,1), 
     legend.justification = c(1, 1)) 
+4

'fill!= colour' – baptiste

+1

@baptiste、answer as post? –

+0

@BenBolkerまあ、テキストはある事を言います、別のコードなので、答えがわかりません。また、私が思いついたことは間違いなく嘘です。 – baptiste

答えて

0

scale_color_fivethirtyeight()の代わりにscale_fill_fivethirtyeight()を使用するとどうなりますか?

mtcars$am <- as.factor(mtcars$am) 
ggplot(mtcars, aes(cyl, mpg, fill=am))+ 
     geom_bar(stat="identity",position="dodge", width=0.75)+ 
     theme_fivethirtyeight()+ 
     theme(axis.text.x=element_text(angle=20,hjust=1,vjust=1, face="bold", size=9), 
       axis.text =element_text(face="bold"), 
       axis.title= element_text(face="bold"), 
       legend.position=c(1,1), 
       legend.justification = c(1, 1)) + 
     scale_fill_fivethirtyeight() 
関連する問題