3
我似乎無法在ggplot2中設置功能區來顯示。ggplot2中缺少功能區
這裏有一個由數據集:
> GlobalDFData
Estimate Upper Lower Date Area
1 100 125 75 Q1_16 Global
2 125 150 100 Q2_16 Global
3 150 175 125 Q3_16 Global
4 175 200 150 Q4_16 Global
下面是我沒有成功嘗試的代碼。我得到的折線圖,但沒有上限和下限
ggplot(GlobalDFData, aes(x = Date)) +
geom_line(aes(y = Estimate, group = Area, color = Area))+
geom_point(aes(y = Estimate, x = Date))+
geom_ribbon(aes(ymin = Lower, ymax = Upper))
真棒 - 正是我需要的。幾乎看起來像一個錯誤,因爲它在參數之間不一致! – user1357015