wilkox / gggenes

➡️️➡️️⬅️️➡️️ Draw gene arrow maps in ggplot2
http://wilkox.org/gggenes
489 stars 49 forks source link

removing distance between line and arrows #56

Closed esraagithub closed 1 year ago

esraagithub commented 1 year ago

hello

could you help me to remove this distance Capture considering my code like this ggplot(df, aes(xmin = Start, xmax = End, y=BGC, fill = Category, forward = Orientation)) + geom_gene_arrow()+#arrowhead_height = unit(3, "mm"), arrowhead_width = unit(3, "mm"))+

  labs(x='Locus (bp)', y='', title=df_4gggenes$BGC[1]) +

  scale_fill_brewer( palette = "Set3", na.value=NA)+
  theme_genes() %+replace% theme(axis.title.x=element_text(),
                                 axis.ticks.y = element_blank(),
                                 axis.text.y=element_blank(),
                                 legend.direction="horizontal",
                                 legend.position="bottom")
wilkox commented 1 year ago

Hi @esraagithub, what is in the df data frame?

esraagithub commented 1 year ago

Hi @esraagithub, what is in the df data frame?

like that Capture

wilkox commented 1 year ago

Thanks @esraagithub. It's still a bit hard for me to help you without extra information. Could you please create a reprex with your code? Thanks

gdanetzk commented 3 months ago

In case anyone else comes across this issue when conducting analysis with gggenes. I thought I would share my solution to the question posed here. Adding expand arguments to scale_y_continuous allows the user to remove the excess whitespace around the molecules that occur when faceting.

# No space below the bars but 10% above them
ggplot(mtcars) +
  geom_bar(aes(x = factor(cyl))) +
  scale_y_continuous(expand = expansion(mult = c(0, .1)))