Question: Fill the color in a graph in a reverse scale - gtrellis
0
gravatar for Vinicius Henrique da Silva
2.9 years ago by
Brazil

   I would like to fill the graph within the polygons instead out of it. 

    library(gtrellis)
    library(circlize)
 
    tiff("plot.tiff", units="in", width=11, height=8.5, res=300, compress = "lzw")

    load(system.file("extdata", "DMR.RData", package = "circlize"))
    DMR_hyper_density = circlize::genomicDensity(DMR_hyper, window.size = 1e7)
    head(DMR_hyper_density)
    
    gtrellis_layout(n_track = 4, ncol = 4, byrow = FALSE,
        track_axis = c(FALSE, TRUE, TRUE, FALSE), 
        track_height = unit.c(2*grobHeight(textGrob("chr1")), 
                              unit(1, "null"), 
                              unit(0.5, "null"), 
                              unit(3, "mm")), 
        track_ylim = c(0, 1, 0.013, 0, 0, 0.013, 0, 1),
        track_ylab = c("", "log10(inter_dist)", "density", ""))
    # track for genomic density
    add_lines_track(DMR_hyper_density, DMR_hyper_density[[4]], area = TRUE, 
      gp = gpar(fill = "pink", bg="pink"))
    add_lines_track(DMR_hyper_density, DMR_hyper_density[[4]], area = TRUE, 
      gp = gpar(fill = "pink"))

    dev.off()

Please not that the track containing the graph is in a reverse scale (It starts from the track top - from 0.013 to 0). I tried to use `bg` with `fill` in the `gp` in one track trying to achieve the desired effect without success. 

Some idea how to fill within the line with pink in a reverse scale like that?

 

gtrellis • 356 views
ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by Vinicius Henrique da Silva30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 169 users visited in the last hour