How to use ggforce(Visualization) Package in R
library(tidyverse) library(ggforce) library(nycflights13) p <- airports %>% filter(lon < 0, tzone != "\\N") %>% ggplot(aes(lon, lat, color = tzone)) + geom_point(show.legend = FALSE) p p + geom_mark_rect() p + geom_mark_rect(aes(label = tzone)) p + geom_mark_rect(aes(label = tzone), show.legend = FALSE) + theme_void() p + geom_mark_hull(aes(label = tzone)) + theme_void() p + geom_mark_hull(aes(label = tzone, fill = tzone), show.legend = FALSE) + theme_void() p + geom_mark_hull(aes(label = tzone, fill = tzone), show.legend = FALSE, expand = unit(3, "mm")) + theme_void() p + geom_mark_hull(aes(label = tzone, fill = tzone), show.legend = FALSE, expand = unit(3, "mm")) + theme_no_axes() p + facet_zoom(xlim = c(-155, -160.5), ylim = c(19, 22.3)) p + geom_mark_hul...







Comments
Post a Comment