Passing data argument inside geom_segment doesn't work
Issue #14
new
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)
-
-
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).
- Log in to comment
I’ve seen this relative to
ggplot
functions. I think it may be howggtern
updates toz
values. This also occurs with other functions likegeom_line
, when theaes
call is in geom_line.
This is related to the code in: https://bitbucket.org/nicholasehamilton/ggtern/src/master/R/ggtern-constructor.R