ivanek / Gviz

This is the Gviz development repository. Gviz plots data and annotation information along genomic coordinates.
https://bioconductor.org/packages/Gviz/
Artistic License 2.0
75 stars 10 forks source link

log scale without transformation? #91

Open jayoung opened 6 months ago

jayoung commented 6 months ago

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 commented 6 months ago

gviz_logScale_request