プロット内のさまざまなファセットにパネルラベルを追加しようとしています。1:7にしたいのですが、次のコード
d <- ggplot(diamonds, aes(carat, price, fill = ..density..)) +
xlim(0, 2) + stat_binhex(na.rm = TRUE) + opts(aspect.ratio = 1)
d1<-d + facet_wrap(~ color)
d1+annotate("text", x=0.25, y=1.5e+04, label=1:7)
収量
Error: When _setting_ aesthetics, they may only take one value. Problems: label
これで、単一の値を指定して、それをすべてのファセットに複製できます。しかし、annotate()を使用して、さまざまなファセットにさまざまなラベルを付けるにはどうすればよいですか?