Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
177 stars 15 forks source link

Handling of multiple geoms with their own data in facet_wrap is broken #101

Open Vindaar opened 3 years ago

Vindaar commented 3 years ago

With the following data ranges for the two geoms:

1. (low: 4.740334241187842, high: 5.570311792097331)                                                                                                                                                                                                                                                                                                                                                                                
2. (low: 1.966464433299198, high: 2.030504138958957)       

the plot cannot be created, because we only look at the geoms dataframe to compute the scale if scale is set to free for the facet wrap.

  ggplot(dfTime, aes("timestamp", "energy")) +
    facet_wrap("runPeriods", scales = "free") +
    geom_point(alpha = some(0.5)) +
    geom_point(data = df, aes = aes(x = "timestamp", y = "photoEsc"),
               color = some(parseHex("FF00FF"))) + #f{`photo` / `escape`})) +
    scale_x_continuous(labels = formatTime) +
    xlab(rotate = -45, alignTo = "right") +
    ggtitle(&"Mean of total charge within {interval:.1f} min, {titleSuff}") +
    ggsave(&"{outpath}/photo_div_escape_vs_time.pdf", width = 1920, height = 1080)