-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotations disappear when setting a high y_position #48
Comments
Sorry, without a minimal reproducible example I cannot help you. The trick usually is to manually increase the domain of the y-axis ( |
Hi const-ae, I had the same issue as arnssino. I really like the 'ggsignif' package, but I would highly recommend that there be a way to move the annotations (labels) for the significance bars and symbols. In my instance, my original data had some extreme outliers, which I did not want to show in my geom_boxplot. So, I removed the extreme outliers for visual purposes. The big issue is that I am unable to correctly display the results of the 'geom_signif' function from the "original data", because the function still wants to put the annotations/labels way up high on the y-axis of my geom_boxplot of the "outliers removed" data. Fortunately the 'geom_signif' results from the "outliers removed" data were the same on the "original" data (significance level), so it was not an issue. However, if they were different then that would be an issue. Just a thought. Best, |
Hi Brittany, I have to admit, I am still not quite sure that I understand what this issue is about. I made a small reproducible example, where I use library(ggplot2)
library(ggsignif)
ggplot(mtcars, aes(x=as.factor(cyl), y=mpg)) +
geom_boxplot() +
geom_signif(comparison = list(c("4", "6")),
y_position = 40) +
coord_cartesian(ylim = c(0, 50))
#> Warning in wilcox.test.default(c(22.8, 24.4, 22.8, 32.4, 30.4, 33.9,
#> 21.5, : cannot compute exact p-value with ties ggplot(mtcars, aes(x=as.factor(cyl), y=mpg)) +
geom_boxplot() +
geom_signif(comparison = list(c("4", "6")),
y_position = 40) +
coord_cartesian(ylim = c(0, 50)) +
ylim(0, 25)
#> Warning: Removed 6 rows containing non-finite values (stat_boxplot).
#> Warning: Removed 6 rows containing non-finite values (stat_signif).
#> Warning in wilcox.test.default(c(22.8, 24.4, 22.8, NA, NA, NA, 21.5, NA, :
#> cannot compute exact p-value with ties
#> Warning: Removed 3 rows containing missing values (geom_signif). Created on 2019-07-01 by the reprex package (v0.2.1) |
Hello, |
Hi Brittany, |
I'm running into a similar issue here, which I think is best split in two parts, taking the original reprex as a starting point ( library(ggplot2)
library(ggsignif)
ggplot(mtcars, aes(x=as.factor(cyl), y=mpg)) +
geom_boxplot() +
geom_signif(comparison = list(c("4", "6")),
y_position = 40) +
coord_cartesian(ylim = c(0, 50))
Note how the bar below is no longer at 40, but above that (and the end of tips also end above 40). I'm not sure if this is intended.
library(ggplot2)
library(ggsignif)
mtcars$mpg[mtcars$cyl=="4"][1] = 1000
ggplot(mtcars, aes(x=as.factor(cyl), y=mpg)) +
geom_boxplot() +
geom_signif(comparison = list(c("4", "6")),
y_position = 40) +
coord_cartesian(ylim = c(0, 50)) # removing this line draws the comparison higher than y_position If I then set the limits much above the requested library(ggplot2)
library(ggsignif)
mtcars$mpg[mtcars$cyl=="4"][1] = 1000
ggplot(mtcars, aes(x=as.factor(cyl), y=mpg)) +
geom_boxplot() +
geom_signif(comparison = list(c("4", "6")),
y_position = 40) +
coord_cartesian(ylim = c(0, 100)) |
Hi,
I am using this wonderful package, which I found very useful to my work, and I am faced with a little problem here.
I am trying to do a violin plot using Seurat package.
It needs a bit of refinement because the annotation overlaps other part of the plot, so I set y_position from 8 to 9
However, the annotation disappeared, and I do not know how to fix this.
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: