Skip to content
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

the order of category in x-axis is not correspond to figure label #600

Open
bioluria opened this issue Apr 15, 2024 · 1 comment
Open

the order of category in x-axis is not correspond to figure label #600

bioluria opened this issue Apr 15, 2024 · 1 comment

Comments

@bioluria
Copy link

bioluria commented Apr 15, 2024

myargs <- commandArgs(TRUE)

if (!length(myargs)){
	print("[USAGE] Rscript cptmt_switch.r <demo_table>")
	q()
}

library(ggplot2)
library(ggpubr)
switch_table <- read.delim(myargs[1], as.is=TRUE)
compare <- list(c("A2A", "B2B"), c("A2A", "A2B"), c("A2A", "B2A"), 
	c("B2B", "A2B"), c("B2B", "B2A"), c("A2B", "B2A"))
ggboxplot(data=switch_table, x="Switch", y="GC", palette="Set2", fill="Switch", ylab="GC content (%)", outlier.size=-1, notch=TRUE, legend.title="") + 
ylim(30, 85) + 
theme_pubr(base_size=16, border=TRUE) +
theme(axis.title.x=element_blank()) +
stat_compare_means(comparisons=compare, size=4, tip.length=0)
ggsave("ggpubr_debug.png", width=10, height=7, dpi=600)

input table as follows:
demo.xls

output figure as below:
xx

Compared to the case without using stat_compare_means, it is speculated that the x-axis should be marked wrong.

@iceautumn
Copy link

I came across the same mistakes, i fixed this by upgrade ggplot2 from 3.4.0 to 3.5.0 using conda and re-install ggpubr using conda . Help this will be useful to u.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants