我想向我的圖中添加一個指數(+ power)(趨勢)線。我正在使用ggplot2軟件包。將exp/power趨勢線添加到ggplot
我有這樣的事情(只是有更多的數據):
require(ggplot2)
df <-read.table("test.csv", header = TRUE, sep = ",")
df
meta temp
1 1.283 6
2 0.642 6
3 1.962 6
4 8.989 25
5 8.721 25
6 12.175 25
7 11.676 32
8 12.131 32
9 11.576 32
ggplot(df, aes(temp, meta)) +
ylab("Metabolism") + xlab("Temperature") +
geom_point() +
theme_bw() +
scale_x_continuous(limits = c(0, 35)) +
scale_y_log10()
我知道,這應該與指數函數來表示 - 所以我的問題是我怎麼能廣告最「指數」擬合?同樣,是否有可能進行動力配合?
stat_smooth()
函數是否有這個機會,或者ggplot2
包中有其他函數我應該用嗎?
歡迎SO。發佈代碼和示例數據+1。 – Andrie