ggplot2 の凡例について質問があります。
2 つの農場での 2 つの異なる色のニンジンの平均長に関する仮説的なデータセットがあるとします。
carrots<-NULL
carrots$Farm<-rep(c("X","Y"),2)
carrots$Type<-rep(c("Orange","Purple"),each=2)
carrots$MeanLength<-c(10,6,4,2)
carrots<-data.frame(carrots)
簡単な棒グラフを作成します。
require(ggplot2)
p<-ggplot(carrots,aes(y=MeanLength,x=Farm,fill=Type)) +
geom_bar(position="dodge") +
opts(legend.position="top")
p
私の質問は: 凡例からタイトル (「タイプ」) を削除する方法はありますか?
ありがとう!