Hello everyone,
I have a problem with vertical error bars they - are way too long and seems to be double error bars
This is the following code I used:
library(tidyverse)
library(readr)
library(ggplot2)
library(ggpubr)
XTTCombined$Drug<-as.factor(XTTCombined$Drug)
XTTCombined$Absorbance<-as.numeric(XTTCombined$Absorbance)
ggplot(XTTCombined, aes( x = Drug, y = Absorbance))+
labs(title = "Comparison of the effect of Vehicle and Nicotinic Acid on microglia",
caption = "XTT Assay") +
labs(x = expression(paste("Treatment")))+
ylab(expression(paste("Absrobance % Change" ~ "(", A[540], " - ", A[650] ~ nm, ")"))) +
geom_point(aes(colour = "tomato"))+
scale_color_manual(name = "Final concentrations and volumes",
labels = c(
bquote("Vehicle (10µL of"~dH[2]*"O)"),
bquote("Nicotinic Acid(10µL of 1mM)")),
values = c(
"Vehicle(10µL of dH20)" = "#2171B5",
"Nicotinic Acid (10µL of 1mM)"= "#D1E5F0"))+
geom_boxplot(
outlier.shape=2,
fill=c("#2171B5", "#DEEBF7"),
width=0.2,
notch = FALSE)+
stat_summary(fun = mean,
colour="black",
geom="point",
shape=18,
size=0.2) +
stat_boxplot(aes(Drug, Absorbance),
geom = "errorbar",
width = 0.2)+
stat_summary(fun.data = mean_se, geom = "errorbar")+
scale_x_discrete(labels = c("Vehicle (Control)", "Nicotinic Acid (1 mM)"))+
stat_compare_means(label.y = 280,
label.x = 1.41)+
scale_y_continuous(breaks = c(0,25, 50,75,100,125,150,175,200,225,250,275))+
geom_signif(comparisons = list(c("Vehicle", "NicAcid")), map_signif_level = TRUE, y_position = c(285), colour = "#cf1b1b")+
theme_bw() +
theme(panel.grid.major = element_line(colour = "#d3d3d3"),
panel.grid.minor = element_blank(),
panel.border = element_blank(), panel.background = element_blank(),
plot.title = element_text(size = 14, face = "bold"))+
theme(axis.text.x = element_text(face="bold", color="#3142b0",
size=8.9, angle=0),
axis.text.y = element_text(face="bold", color="#3142b0",
size=8.9, angle=0))+
scale_linetype_manual('Legend',values='solid')+
scale_shape_manual('',values = 18)+
theme(legend.spacing.y = unit(0.01, "cm"))+
theme(legend.position = c(0.79, .93),
legend.justification = c("left", "top"),
legend.key = element_rect(colour = NA, fill = NA),
legend.background = element_rect(colour = NA, fill = NA))
And this is DataUsed
Thank you so much for any help or tips.