x y axis issue
GuangchuangYu opened this issue · 6 comments
GuangchuangYu commented
According to YuLab-SMU/ggtree#96.
I think ggstance
has an issue of calculating x-y coordinates.
Here is a very simple example:
library(ggplot2)
library(ggstance)
set.seed(123)
d =data.frame(id=rep(1:10, each=20), val=as.vector(sapply(1:30, function(i) rnorm(20, mean=i))))
ggplot(d)+ geom_boxploth(aes(x=val, y=id, group=id))
In this example, y coordinates should range from 1 to 10, but in the above plot, we can find that it range from 0 to 30 which should be the range of x coordinates.
It works fine if y is categorical variable.
## this code works
ggplot(d)+ geom_boxploth(aes(x=val, y=factor(id), group=id))
lionel- commented
It seems this is now fixed somehow. Thanks for the report!
GuangchuangYu commented
still not working with:
> packageVersion("ggplot2")
[1] ‘3.0.0’
> packageVersion("ggstance")
[1] ‘0.3’
lionel- commented
I haven't sent the development version to CRAN yet. Can you try with master?
GuangchuangYu commented
yes, it works now. Thanks!
GuangchuangYu commented
I have this problem with my geom too. @lionel- can you give me some ideas of how this problem was solved?
lionel- commented
Sorry I don't know :/