sirrice / pygg

ggplot2 syntax in python. Actually wrapper around Wickham's ggplot2 in R
MIT License
72 stars 9 forks source link

ggplot with two data #22

Open Ireneruru opened 2 years ago

Ireneruru commented 2 years ago

In this R script, there are two data: mean_wt and mtcars. However, current pygg only resolve one data and can not resolve the mean_wt.

mean_wt <- data.frame(cyl = c(4, 6, 8), wt = c(2.28, 3.11, 4.00))
ggplot(mtcars, aes(mpg, wt, colour = wt)) +
  geom_point() +
  geom_hline(aes(yintercept = wt, colour = wt), mean_wt) +
  facet_wrap(~ cyl)

Example source

sirrice commented 2 years ago

cool! definitely a common usecase, especially when created layered plots. it requires uniquely naming each dataset turning the transpilation. want to open a pr for it?