使用假設資料,我想在一個圖中生成這三個圖。 
我想知道我該怎么做。是否可以使用 ggplot2 或 fGarch 包來做到這一點?
uj5u.com熱心網友回復:
這是ggplot2 的一種方法
library("ggplot2")
x <- 0:100
y <- c(dnorm(x, mean=50, sd=10),
dlnorm(x, meanlog=3, sdlog=.7),
dlnorm(100-x, meanlog=3, sdlog=.7))
df <- data.frame(
x=x,
y=y,
type=rep(c("normal", "right skewed", "left skewed"), each=101)
)
ggplot(df, aes(x, y, color=type)) geom_line()

轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/358900.html
