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

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

    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)
    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"))

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 • 392 views
ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by Vinicius Henrique da Silva40
Please log in to add an answer.


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