View source: R/coord_panel_ranges.r
coord_panel_ranges | R Documentation |
任意のfacetパネルをズームする.
coord_panel_ranges(panel_ranges, expand = TRUE, default = FALSE, clip = "on")
panel_ranges |
Limits of axes or an axis. |
expand |
Add margin to each axes or an axis, Default: TRUE |
default |
Is this the default coordinate system? If |
clip |
Should drawing be clipped to the extent of the plot panel? A
setting of |
See vignette("coord_panel_ranges")
ggproto object
https://andburch.github.io/ggplot_facets https://stackoverflow.com/questions/63550588/ggplot2coord-cartesian-on-facets
ggproto
coord_cartesian
library(frabento)
library(ggplot2)
library(magrittr)
theme_set(theme_linedraw(base_family = "Helvetica", base_line_size = 0.3) +
theme(aspect.ratio = 1/1, legend.position = c(0.75, 0.25)))
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) +
geom_point(aes(color = Species)) +
geom_rect(data = . %>% dplyr::filter(Species == "versicolor"),
xmin = 5.5, xmax = 6.5, ymin = 2.5, ymax = 3,
color = "red", linewidth = 1, fill = NA) +
facet_wrap(~ Species, scale = "free", ncol = 2) +
coord_panel_ranges(panel_ranges = list(
list(NULL),
list(x = c(5.4, 6.6), y = c(2.4, 3.1)),
list(NULL)
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.