ChrisLou-bioinfo / gg.gap

Easy to define segments in y-axis for 'ggplot2'.
GNU General Public License v3.0
27 stars 5 forks source link

the element_text of ylabel doesn't work after gg.gap #6

Open zhou-sumei opened 1 year ago

zhou-sumei commented 1 year ago

Hi, I have to say this function is useful ,but I met a problem when I user it, the ylabel test size setting in my ggplot() doesn't work after gg.gap, here is my code and plot:

main_theme = theme(panel.background=element_blank(),panel.grid=element_blank(), panel.border = element_rect(color="black",size=0.8,linetype="solid"), axis.ticks=element_line(color="black"), # axis.text=element_text(color="black", size=18), # legend.position="right", legend.background=element_blank(), legend.key=element_blank(), legend.text= element_text(size=18), text=element_text(family="sans", size=18), # 指定所有字的字体 plot.title=element_text(hjust = 0.5,vjust=0.5,size=18), plot.subtitle=element_text(size=18)) acc_win_element <- ggplot(element_info_of_win_new_stand, aes(x=element_type_uniform, fill=element_type_uniform))+ geom_bar()+ theme_bw()+ main_theme

image

when I add the gg.gap like this : gg.gap(plot=acc_win_element, segments=list(c(50,550)), vjust=-1, tick_width=c(10,30), rel_heights=c(0.7,0.02,0.2), ylim=c(0,610))

image

the ylabel text size doesn't work , I don't know how to fix the ylabel setting, your suggestions will do me a big favor, thank you ~