Open YuZhang-learner opened 3 years ago
Dear all, I dont know why there is a error in add gap to the reverse t axis
`mypal <- pal_npg("nrc", alpha = 1)(9) x1 <- x$data %>% mutate( Genus = factor( Genus,levels = c("Fusarium","Pseudeurotium","Mortierella","Penicillium", "Arthrobotrys","Trichoderma","Talaromyces","Westerdykella", "Aspergillus","Zopfiella","Saitozyma", "Curvularia","Psilocybe","Plectosphaerella","Emericellopsis", "Metarhizium","Clonostachys","Paraglomus","Byssonectria") )) %>% ggplot(aes(x=Genus,y=Abundance,fill= Genus)) + geom_col(position = position_dodge(width = 0.9), width = 0.7) + geom_hline(yintercept = 0) + scale_fill_manual(values=c("Pseudeurotium"="#E64B35FF", "Penicillium"="#4DBBD5FF", "Talaromyces"="#00A087FF", "Zopfiella"="#3C5488FF", "Saitozyma"="#F39B7FFF", "Curvularia"="#8491B4FF", "Psilocybe"="#91D1C2FF", "Emericellopsis"="#DC0000FF", "Clonostachys"="#7E6148FF"))+ scale_x_discrete(labels=NULL,position = "top",breaks=NULL)+ scale_y_continuous( expand = c(0,0), trans = "reverse" ) + xlab (NULL) +
ylab(NULL)+ theme( panel.grid = element_blank(), panel.background = element_rect(fill = 'transparent'), axis.line.y = element_line(colour = 'black'), plot.title = element_text(hjust = 0.5, face = 'plain'), axis.line.x.top = element_blank(),legend.position = 'none' )
x1 gg.gap(plot = x1,segments = c(30,2),ylim=c(100,0))`
I do a revrse y axis, it should be "segments = c(30,2),ylim=c(100,0))' So,why is it?
I also found that, it cant add a gap on a plot after the X-axis and the Y-axis are switched.
Dear all, I dont know why there is a error in add gap to the reverse t axis
`mypal <- pal_npg("nrc", alpha = 1)(9) x1 <- x$data %>% mutate( Genus = factor( Genus,levels = c("Fusarium","Pseudeurotium","Mortierella","Penicillium", "Arthrobotrys","Trichoderma","Talaromyces","Westerdykella", "Aspergillus","Zopfiella","Saitozyma", "Curvularia","Psilocybe","Plectosphaerella","Emericellopsis", "Metarhizium","Clonostachys","Paraglomus","Byssonectria") )) %>% ggplot(aes(x=Genus,y=Abundance,fill= Genus)) + geom_col(position = position_dodge(width = 0.9), width = 0.7) + geom_hline(yintercept = 0) + scale_fill_manual(values=c("Pseudeurotium"="#E64B35FF", "Penicillium"="#4DBBD5FF", "Talaromyces"="#00A087FF", "Zopfiella"="#3C5488FF", "Saitozyma"="#F39B7FFF", "Curvularia"="#8491B4FF", "Psilocybe"="#91D1C2FF", "Emericellopsis"="#DC0000FF", "Clonostachys"="#7E6148FF"))+ scale_x_discrete(labels=NULL,position = "top",breaks=NULL)+ scale_y_continuous( expand = c(0,0), trans = "reverse" ) + xlab (NULL) +
ylab ("Soil Relative Abundance (%)") +
ylab(NULL)+ theme( panel.grid = element_blank(), panel.background = element_rect(fill = 'transparent'), axis.line.y = element_line(colour = 'black'), plot.title = element_text(hjust = 0.5, face = 'plain'), axis.line.x.top = element_blank(),legend.position = 'none' )
x1 gg.gap(plot = x1,segments = c(30,2),ylim=c(100,0))`
I do a revrse y axis, it should be "segments = c(30,2),ylim=c(100,0))' So,why is it?
I also found that, it cant add a gap on a plot after the X-axis and the Y-axis are switched.