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

Y axis and track name disappear for nested OverlayTrack #62

Closed robert-gnuegge closed 2 years ago

robert-gnuegge commented 2 years ago

When the first track of an OverlayTrack is an OverlayTrack itself, the y axis disappears and the track title is replaced with "OverlayTrack".

library(Gviz)

set.seed(0)
gr1 <- GRanges(seqnames = "chrI", ranges = IRanges(start = 1:10, width = 1), score = sample(x = 1:10 / 10, size = 10, replace = TRUE))
gr2 <- GRanges(seqnames = "chrI", ranges = IRanges(start = 1:10, width = 1), score = sample(x = 1:10 / 10, size = 10, replace = TRUE))
gr3 <- GRanges(seqnames = "chrI", ranges = IRanges(start = 1:10, width = 1), score = sample(x = 1:10 / 10, size = 10, replace = TRUE))

dt1 <- DataTrack(range = gr1, type = "l", name = "My Track")
dt2 <- DataTrack(range = gr2, type = "l", col = "blue")
dt3 <- DataTrack(range = gr3, type = "l", col = "red")

plotTracks(trackList = list(dt1, dt2, dt3), chromosome = "chrI")

pic1

plotTracks(trackList = list(OverlayTrack(trackList = list(dt1, dt2, dt3))), chromosome = "chrI")

pic2

plotTracks(trackList = list(OverlayTrack(trackList = list(dt1, OverlayTrack(trackList = list(dt2, dt3))))), chromosome = "chrI")

pic3

plotTracks(trackList = list(OverlayTrack(trackList = list(OverlayTrack(trackList = list(dt1, dt2)), dt3))), chromosome = "chrI")

pic4

sessionInfo()
attached base packages:
[1] grid      stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plotrix_3.8-2        rtracklayer_1.54.0   zoo_1.8-9            Gviz_1.38.3          GenomicRanges_1.46.1
[6] GenomeInfoDb_1.30.1  IRanges_2.28.0       S4Vectors_0.32.3     BiocGenerics_0.40.0 
ivanek commented 2 years ago

Hi @robert-gnuegge,

I have just fixed it in devel version which will come to release in next weeks.

Rohit-Satyam commented 2 years ago

@robert-gnuegge @ivanek . How did you alter the Plot's Y axis. I wish to remove the grey and white contour used for plots because it's kind of blinding me. As this is not a ggplot, I am having a hard time understanding it. Please hlep!!

robert-gnuegge commented 2 years ago

Hi @Rohit-Satyam, You can modify the y axis panel colors by changing the parameters background.title, fontcolor.title, and col.axis.

P.S. I don't think this issue tracker is the right place to ask this kind of questions. Rather use the Bioconductor support site.