Passing data argument inside geom_segment doesn't work

Issue #14 new
Kevin Middleton created an issue

Passing data inside of geom_segment leads to a warning:

Ignoring unknown aesthetics: z, zend

and no plot. Using the demo code:

df <- data.frame(x=0.6,y=0.2,z=0.2,xend=0.2,yend=0.6,zend=0.2)

ggtern(data=df,aes(x,y,z,xend=xend,yend=yend,zend=zend)) +
  geom_segment(size=2,arrow=arrow(),color="red")

works as expected, but

ggtern() +
  geom_segment(data=df,aes(x,y,z,xend=xend,yend=yend,zend=zend),
               size=2,arrow=arrow(),color="red")

does not with the warning above.

Comments (2)

  1. Kevin Middleton reporter

    I’ve had the same problem in ggplot, which you can get around by creating an empty ggplot() and then adding geoms with data =. Until very recently this also worked with ggtern (I have code that ran fine until the most recent updates).

  2. Log in to comment