You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When x coordinates are duplicated geom_area does not align with geom_line. For example, in the following example, some of the x=2 coordinates are shifted back slightly (but visibly).
library(ggplot2) # ggplot2_3.4.1data.frame(x= c(1,2,2,3), y=4:1) |>tidyr::crossing(id= c(0, 1e2)) |>
ggplot(aes(x+id, y)) +
facet_wrap(vars(id), scales='free_x') +
geom_area() +# not aligned with lines from next geom_line
geom_line()
The text was updated successfully, but these errors were encountered:
While each panel has a range of 2 on the x-axis, this fudge factor becomes 0.001 * 103 = 0.103 units, which is visible. I think it might be best to do the alignment calculations per panel instead of for the data as a whole. The stacking, that stat = "align" makes easier, applies on a panel-level rather than the whole data level as well.
When x coordinates are duplicated geom_area does not align with geom_line. For example, in the following example, some of the x=2 coordinates are shifted back slightly (but visibly).
The text was updated successfully, but these errors were encountered: