1
我試圖使在r中使用GGPLOT2這是數據列理想地1將是x軸每月沉澱直方圖,第2列是直方圖和列3將是線圖沉澱直方圖和線圖
Month MonthlyPrecipitation 30YearNormalPrecipitation
January 49.75 67.1
February 8.75 53.6
March 27 64.2
April 55.5 77.7
May 62.25 89.2
June 171.75 84.7
July 50.75 83.6
August 37.25 77.6
September 75.75 92.6
October 99.25 86.3
November 37.25 90.7
December 43.25 78.9
您可以使用'geom_col(alpha = 0.75)'而不是'geom_bar(stat ='identity',alpha = 0.75)'保存一點輸入。 – neilfws
是否存在您應該納入規範的具體信息?我輸入了n,平均值和標準差,並得到了與我的數據完全不同的結果。 –
您可以跳過ggplot行之前的所有內容。因爲你沒有提供一個數據集,所以我創建了一個可重複的數據集。只需輸入: 'ggplot(mydata,aes(x = Month,y = MonthlyPrecipitation))+ geom_bar(stat ='identity',alpha = 0.75)+ geom_line(aes(y = 30Yarar NormalPrecipitation),color =藍色「,group = 1)'mydata'是存儲數據的數據集。 –