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

log scale without transformation? #91

Open
jayoung opened this issue Apr 15, 2024 · 1 comment
Open

log scale without transformation? #91

jayoung opened this issue Apr 15, 2024 · 1 comment

Comments

@jayoung
Copy link

jayoung commented Apr 15, 2024

hi there,

This is just a "wouldn't it be nice" request - I would love it if it were possible to plot graph-like tracks on a log-scaled y-axis, rather than actually transforming the data.

Is there a way to do it in Gviz? I could imagine transforming the data, then hacking into the y-axis labels to un-log them, but that seems like a pain.

See example plot I'll attach to show the kind of thing that would be nice. The code I used to make that is below, although that's less relevant.

thanks again,

Janet

library(tidyverse)
library(patchwork)

dat <- data.frame(x=c(1,2,3,4),
                  y=c(1,10,100,1000) )

p1 <- dat %>% 
    ggplot(aes(x=x, y=y)) +
    geom_col() +
    scale_y_log10() +
    labs(title="I like this y-axis")

p2 <- dat %>% 
    ggplot(aes(x=x, y=log10(y))) +
    geom_col()  +
    labs(title="better than this one")

p1 + p2

ggsave(filename="bug_testing/gviz_logScale_request.png", height=5,width=5)
@jayoung
Copy link
Author

jayoung commented Apr 15, 2024

gviz_logScale_request

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