Skip to content

Commit

Permalink
add 'fontsize()' function
Browse files Browse the repository at this point in the history
  • Loading branch information
jokergoo committed Nov 10, 2017
1 parent df40716 commit 93c3e95
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export(convert_length)
export(convert_x)
export(convert_y)
export(degree)
export(fontsize)
export(generateRandomBed)
export(genomicDensity)
export(getI)
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes in version 0.4.2
* first column is refactorized in `circos.initialize()`
* add names for CELL_META
* add `labels.pos.adjust` in `circos.axis()`
* add `fontsize()` function

Changes in version 0.4.1
---------------------------------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ circos.text = function(x, y, labels, sector.index = get.cell.meta.data("sector.i
}

m = polar2Cartesian(d)

for(i in seq_along(x)) {
text(m[i, 1], m[i, 2], labels = labels[i], srt = srt[i],
cex = cex[i], col = col[i], font = font[i], adj = adj, ...)
Expand All @@ -1112,6 +1113,16 @@ circos.text = function(x, y, labels, sector.index = get.cell.meta.data("sector.i
return(invisible(NULL))
}

# == title
# Convert fontsize to cex
#
# == param
# -x value for fontsize
#
fontsize = function(x) {
x/par("ps")
}

# == title
# Mark the value as a degree value
#
Expand Down
2 changes: 1 addition & 1 deletion man/circos.axis.rd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ circos.axis(h = "top", major.at = NULL, labels = TRUE, major.tick = TRUE,
\item{lwd}{line width for ticks}
\item{col}{color for the axes}
\item{labels.col}{color for the labels}
\item{labels.pos.adjust}{whether to adjust the positions of the first label and the last label}
\item{labels.pos.adjust}{whether to adjust the positions of the first label and the last label. The value can be a vector of length two which correspond to the first label and the last label.}

}
\details{
Expand Down
29 changes: 29 additions & 0 deletions man/fontsize.rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
\name{fontsize}
\alias{fontsize}
\title{
Convert fontsize to cex
}
\description{
Convert fontsize to cex
}
\usage{
fontsize(x)
}
\arguments{

\item{x}{value for fontsize}

}
\details{
It just mark the value as a fontsize setting for \code{\link{circos.text}}

}
\author{
Zuguang Gu <z.gu@dkfz.de>

}
\examples{
# There is no example
NULL

}

0 comments on commit 93c3e95

Please sign in to comment.