Question: Fill the color in a graph in a reverse scale - gtrellis
0
2.7 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")

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
gp = gpar(fill = "pink", bg="pink"))
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 • 340 views