2
In this situation below, how can I adjust the size of the geom_plot()
added to geom_jitter()
once the function tibble(x = 12, y = 4.5, plot = list(dens_iris))
only allowed to identify the intersection of x and y of the upper right corner?
data("iris")
require(ggplot2)
require(ggridges)
dens_iris <- ggplot(iris,aes(y = Species, x = Sepal.Length, fill=factor(..quantile..))) +
stat_density_ridges(geom = "density_ridges_gradient",
calc_ecdf = TRUE,
quantiles = c(0.025, 0.975)) +
theme(legend.position = "bottom",
legend.title = element_text(size = 8),
legend.key.size = unit(0.5,"cm"),
legend.text = element_text(size = 8))
jitter_iris <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width,
shape = Species, fill = Species)) +
geom_jitter(size = 3.5,alpha = 0.4) +
geom_smooth(size = 1) +
scale_x_continuous(limits = c(4,12)) +
theme(legend.position = c(0.9,0.1))
require(dplyr)
data.tb <- tibble(x = 12, y = 4.5, plot = list(dens_iris))
require(ggpmisc)
pl <- jitter_iris + geom_plot(data = data.tb, aes(x, y, label = plot))