我使用scale_colour_manual
來指定我需要的可能顏色。但是,如果我選擇red
,我會得到令人眼花繚亂的紅色,而不是比較溫和的ggplot2默認紅色,如果我首先不使用scale_colour_manual
,則會出現這種紅色。訪問ggplot2默認調色板的標籤或常量是什麼?ggplot2使用scale_colour_manual訪問默認顏色?
ggplot(data=df, aes(x=n, y=rt, group=kernel, shape=kernel, colour=kernel)) +
geom_point(fill="white", size=3) + geom_line() + xlab("n") + ylab("Runtime (s)") +
opts(title=title,plot.title=theme_text(size=font.size)) +
scale_colour_manual(values=c("grey30", "red")) +
opts(legend.position = c(x_shift,0.87),legend.background=theme_rect(fill = "transparent",colour=NA))
請注意,使用'red30'將不起作用,它只適用於灰色由於某種原因我不知道的原因。
嘗試「鮭魚」而不是「紅色」。 –
查看http://stackoverflow.com/questions/8197559/emulate-ggplot2-default-color-palette –