ggpubr icon indicating copy to clipboard operation
ggpubr copied to clipboard

ggviolin wrong y axis when compare two group with small sample number

Open YuntaoTan opened this issue 2 years ago • 0 comments

Hello, when I use ggviolin plot two group, I got wrong y axis.

my data CN_burden max is 4229, min is 141,  but I got fllowing y axis.

image my code is fllowing:

            p <- ggviolin(subdf, x = cnames[gidx], y = burden_col, fill = cnames[gidx],
                palette = c("#00AFBB", "#E7B800"), ylab = burden_col,
                add = "boxplot", add.params = list(fill = "white")) 
            p <-   p + stat_compare_means(comparisons = my_comparisons, 
                    label = "p.signif", na.rm=TRUE) 
            p +   stat_compare_means(label.y = labely,label.x = labelx, na.rm=TRUE)

fllowing is my save.image()

ggviolin.zip

fllowing is my sessionInfo()

R version 4.1.0 (2021-05-18)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /beegfs/work/user/rdd_admin/software/miniconda39/envs/r403/lib/libopenblasp-r0.3.18.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_1.0.7    ggpubr_0.4.0   ggplot2_3.3.5  optparse_1.7.1

loaded via a namespace (and not attached):
 [1] zip_2.2.0         Rcpp_1.0.7        cellranger_1.1.0  pillar_1.6.4     
 [5] compiler_4.1.0    forcats_0.5.1     tools_4.1.0       digest_0.6.28    
 [9] lifecycle_1.0.1   tibble_3.1.6      gtable_0.3.0      pkgconfig_2.0.3  
[13] rlang_0.4.12      openxlsx_4.2.4    cli_3.1.0         DBI_1.1.1        
[17] curl_4.3.2        haven_2.4.3       rio_0.5.27        withr_2.4.2      
[21] hms_1.1.1         generics_0.1.1    vctrs_0.3.8       grid_4.1.0       
[25] getopt_1.20.3     tidyselect_1.1.1  glue_1.4.2        data.table_1.14.2
[29] R6_2.5.1          rstatix_0.7.0     fansi_0.5.0       readxl_1.3.1     
[33] foreign_0.8-81    carData_3.0-4     farver_2.1.0      purrr_0.3.4      
[37] tidyr_1.1.4       car_3.0-11        magrittr_2.0.1    scales_1.1.1     
[41] backports_1.3.0   ellipsis_0.3.2    abind_1.4-5       assertthat_0.2.1 
[45] colorspace_2.0-2  ggsignif_0.6.3    labeling_0.4.2    utf8_1.2.2       
[49] stringi_1.7.5     munsell_0.5.0     broom_0.7.11      crayon_1.4.2     

YuntaoTan avatar Mar 18 '22 01:03 YuntaoTan