annoXaxis {plotgardener} | R Documentation |
Add an x-axis to a plot
annoXaxis( plot, at = NULL, label = TRUE, main = TRUE, scipen = 999, axisLine = FALSE, params = NULL, ... )
plot |
Plot object to annotate with x-axis. |
at |
A numeric vector of x-value locations for tick marks. |
label |
A logical value indicating whether to draw the labels on
the tick marks, or an expression or character vector which specify
the labels to use.
If not logical, must be the same length as the |
main |
A logical value indicating whether to draw the x-axis at the
bottom of the plot. Default value is
|
scipen |
An integer indicating the penalty to be applied when
deciding to print numeric values in fixed or exponential notation.
Default value is |
axisLine |
A logical value indicating whether to show the axis line.
Default value is |
params |
An optional pgParams object containing relevant function parameters. |
... |
Additional grid graphical parameters. See gpar. |
Returns a xaxis
object containing
relevant grob information.
## Load transcript information library("TxDb.Hsapiens.UCSC.hg19.knownGene") library("org.Hs.eg.db") ## Create page pageCreate(width = 7.5, height = 4.5, default.units = "inches") ## Plot gene transcripts transcriptPlot <- plotTranscripts( chrom = "chr1", chromstart = 1000000, chromend = 2000000, assembly = "hg19", x = 0.5, y = 0, width = 6.5, height = 4, just = c("left", "top"), default.units = "inches" ) ## Add standard x-axis to transcript plot annoXaxis( plot = transcriptPlot, at = c(1000000, 1250000, 1500000, 1750000, 2000000), fontsize = 8 ) plotText( label = "Basepairs", fontsize = 10, fontface = "bold", x = 3.75, y = 4.3, just = "top" ) ## Hide page guides pageGuideHide()