私は、特定の自然現象の発生を年ごとにマッピングし、時間とともに増加することを示すデータセットを持っています。データは次のとおりです。R:棒グラフ内の実線バーの上に点線「予測」があります
Year Value
2012 10
2013 45
2014 212
2015 560
2016 570
しかし、2016年は、不完全なデータに基づいています(のみ2016年7月の終わりまで)。したがって、私は基本的には通常の棒グラフが好きですが、上に点在する2016年の '予測値'の完全な値は実線です。私ができる - 点線/「予測」そうでない場合は、テクスチャ、最終的なバーの上のセクションに追加する方法
test_DF = data.frame(Year = c("2012", "2013", "2014", "2015", "2016"),
Count = c(10, 45, 212, 560, 570))
base_graph = ggplot(test_DF, aes(x = test_DF$Year, y = test_DF$Count),
main = "Growth of Natural Phenomenon", xlab = "Year",
ylab = "Number of Occurences")
final_growth = base_graph + geom_bar(stat = 'identity', fill="#4F81BD") + theme_few() + labs(title="Growth of Natural Phenomenon", y="Number of Occurences",x="") +
geom_text(aes(label=test_DF$Count, vjust=-0.4)) + ylim(0, 1000)
しかし、私は考えている:私は基本的なグラフのggplot2を使用していますが、これは私がこれまで持っているものですGoogleで類似のものを見つけることはできません。何かアドバイスを事前に
ありがとう:私は希望のグラフは、このようなものです!