teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
https://teunbrand.github.io/ggh4x/
Other
542 stars 33 forks source link

`geom_pointpath` throws error when group only has 1 member #43

Closed teunbrand closed 3 years ago

teunbrand commented 3 years ago
library(ggplot2)
library(ggh4x)

df <- data.frame(x = 1, y = 1)

ggplot(df, aes(x, y)) +
  geom_pointpath()
#> Error in unit(data$x, "npc"): 'x' and 'units' must have length > 0

Created on 2021-06-10 by the reprex package (v1.0.0)

teunbrand commented 3 years ago

This now works:

library(ggplot2)
library(ggh4x)

df <- data.frame(x = 1, y = 1)

ggplot(df, aes(x, y)) +
  geom_pointpath()

Created on 2021-06-21 by the reprex package (v1.0.0)