まとめ一覧
Theme 設定
- 単純にグラフにtheme_XXX()を足すだけで、お手軽にテーマ設定ができます。
text_label_of_clarity <- c("含まれる",
"わずかにSI2","わずかにSI1",
"ほんのわずかにVS2","ほんのわずかにVS1",
"ごくごくわずかにVVS2","ごくごくわずかにVVS1",
"内部が無傷")
graph <- ggplot(diamonds) +
geom_histogram(aes(carat, fill = clarity)) +
labs(title = "値段と重さと透明度の関係", x = "重さ(カラット)", y = "値段") +
scale_fill_discrete(name = "透明度",
labels = text_label_of_clarity)
graph
graph + theme_gray()
graph + theme_bw()
graph + theme_linedraw()
graph + theme_light()
graph + theme_dark()
graph + theme_minimal()
graph + theme_classic()
?theme
- 色々なテーマを集めた、
ggthemes
パッケージというものがあります。
install.packages("ggthemes")
graph + ggthemes::theme_base()
graph + ggthemes::theme_calc()
graph + ggthemes::theme_economist()
graph + ggthemes::theme_economist_white()
graph + ggthemes::theme_excel()
graph + ggthemes::theme_few()
graph + ggthemes::theme_fivethirtyeight()
graph + ggthemes::theme_gdocs()
graph + ggthemes::theme_stata()
graph + ggthemes::theme_wsj()
まとめ一覧