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

stack_with affects x axis tick positions #5

Open
pwwang opened this issue Dec 15, 2017 · 0 comments
Open

stack_with affects x axis tick positions #5

pwwang opened this issue Dec 15, 2017 · 0 comments

Comments

@pwwang
Copy link

pwwang commented Dec 15, 2017

This is a great package with a lot of flexibilities!

But When I tried to adjust the width of the letters, the x axis moved!
Notice the alignment between the ticks of ggseqlogo plot and the sequence letters in following plots.
If I used default stack_width, which is .95, I've got:

capture

Then if I set it to .5:
capture2
The vertical grids became a little bit narrower, even though not so obvious by eyes.

But if I set it to 0.01:
capture3
Note the relative positions of the ticks to the sequence letters, it is exactly what I want!

The sequences were plotted by ggplot2's geom_text, and the plots were arranged by gtable:

library(ggplot2)
library(ggseqlogo)
library(gtable)
library(grid)
# ... generating the  plots
g   <- gtable(unit(1, "npc"), unit(c(.7, .05, .05, .2), "npc"))
g   <- gtable_add_grob(g, gcurvgrob, 1, 1)
g   <- gtable_add_grob(g, gtable1grob, 2, 1)
g   <- gtable_add_grob(g, gtable2grob, 3, 1)
g   <- gtable_add_grob(g, glogogrob, 4, 1)
grid.newpage()
grid.draw(g)

If I just try to solely plot with ggseqlogo, with stack_width 0.95:
capture5

For stack_width 0.01:
capture4

You can easily tell the different padding from the first tick to the left border. Of course, as a single plot, it is completely OK, but I expect the stack_width shouldn't affect the tick positions so that we can better align the seqlogo to other plots.

By the way, the motif length is actually 9 (marked in the plots), the rest regions are filled with zeros.

Thanks!

@pwwang pwwang changed the title stack_with affects x axis tick position stack_with affects x axis tick positions Dec 15, 2017
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

1 participant