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

Determining/forcing a uniform logo symbols stack order #3

Open
mathieudupont opened this issue Oct 25, 2016 · 0 comments
Open

Determining/forcing a uniform logo symbols stack order #3

mathieudupont opened this issue Oct 25, 2016 · 0 comments

Comments

@mathieudupont
Copy link

mathieudupont commented Oct 25, 2016

With position="classic", is there a way to force the (vertical) order of the symbols, instead of using the frequency values? For example, if my symbols are "A", "C", "G" and "U" and I would like them to be always A on top of C, C on top of G and G on top of U, for each position, no matter what are their respective frequencies, how can I force that?
In the following minimal example, I would like the two stacks to be in the ACGU order.
Thank you!

library(ggplot2)
library(gglogo)

position = c(1, 1, 1, 1, 2, 2, 2, 2)
element = c("A", "C", "G", "U", "A", "C", "G", "U")
freq = c(0.27, 0.26, 0.24, 0.23, 0.26, 0.27, 0.23, 0.24)
d = data.frame(position, element, freq)

figure = ggplot(data=d) +
geom_logo(aes(x=position, y=freq, label=element, fill=element), position="classic")

pdf("minimal_example.pdf")
print(figure)
dev.off()

minimal_example.pdf

@mathieudupont mathieudupont changed the title Determining/forcing the logo symbols order. Determining/forcing a uniform logo symbols stack order Oct 25, 2016
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

2 participants