Skip to content

Commit

Permalink
add 'area' argument in 'circos.trackHist()'
Browse files Browse the repository at this point in the history
  • Loading branch information
jokergoo committed Nov 20, 2017
1 parent 6129c3b commit c00a39b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ importFrom("colorspace", XYZ)
importFrom("colorspace", coords)
importFrom("colorspace", hex)
importFrom("colorspace", sRGB)
importFrom("grDevices", "dev.cur", "dev.prev", "dev.set")
importFrom("grDevices", "dev.off", "pdf")
importFrom("grDevices", as.raster)
importFrom("grDevices", col2rgb)
Expand All @@ -107,4 +108,4 @@ importFrom("stats", rnorm)
importFrom("stats", runif)
importFrom("utils", download.file)
importFrom("utils", read.table, packageDescription)
importFrom("grDevices", "dev.cur", "dev.prev", "dev.set")

2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changes in version 0.4.3
--------------------------------------------------------------------------

* `circos.trackHist()`: add `area` argument to add filled color under density lines.

Changes in version 0.4.2
---------------------------------------------------------------------------

Expand Down
5 changes: 3 additions & 2 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,7 @@ circos.yaxis = function(side = c("left", "right"), at = NULL, labels = TRUE, tic
# -include.lowest see `graphics::hist`
# -right see `graphics::hist`
# -draw.density whether draw density lines instead of histogram bars.
# -area whether to fill the area below the density lines. If it is set to ``TRUE``, ``col`` controls the filled color in the area and ``border`` controls color of the line.
# -bin.size size of the bins of the histogram
#
# == details
Expand All @@ -1594,7 +1595,7 @@ circos.trackHist = function(factors, x, track.height = circos.par("track.height"
border = "black", lty = par("lty"), lwd = par("lwd"),
bg.col = NA, bg.border = "black", bg.lty = par("lty"), bg.lwd = par("lwd"),
breaks = "Sturges", include.lowest = TRUE, right = TRUE, draw.density = FALSE,
bin.size = NULL) {
bin.size = NULL, area = FALSE) {

# basic check here
if(length(x) != length(factors)) {
Expand Down Expand Up @@ -1662,7 +1663,7 @@ circos.trackHist = function(factors, x, track.height = circos.par("track.height"

if(draw.density) {
circos.trackLines(factors = fa, xx, yy, track.index = track.index,
col = col, lty = lty, lwd = lwd)
col = col, lty = lty, lwd = lwd, area = area, border = border)
} else {
# in each cell, draw rectangles
col = recycle.with.levels(col, le)
Expand Down
3 changes: 2 additions & 1 deletion man/circos.trackHist.rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ circos.trackHist(factors, x, track.height = circos.par("track.height"),
border = "black", lty = par("lty"), lwd = par("lwd"),
bg.col = NA, bg.border = "black", bg.lty = par("lty"), bg.lwd = par("lwd"),
breaks = "Sturges", include.lowest = TRUE, right = TRUE, draw.density = FALSE,
bin.size = NULL)
bin.size = NULL, area = FALSE)
}
\arguments{

Expand All @@ -33,6 +33,7 @@ circos.trackHist(factors, x, track.height = circos.par("track.height"),
\item{include.lowest}{see \code{\link[graphics]{hist}}}
\item{right}{see \code{\link[graphics]{hist}}}
\item{draw.density}{whether draw density lines instead of histogram bars.}
\item{area}{whether to fill the area below the density lines. If it is set to \code{TRUE}, \code{col} controls the filled color in the area and \code{border} controls color of the line. }
\item{bin.size}{size of the bins of the histogram}

}
Expand Down

0 comments on commit c00a39b

Please sign in to comment.