spiral_track: Add a new track or move to an existed track

View source: R/track.R

spiral_trackR Documentation

Add a new track or move to an existed track

Description

Add a new track or move to an existed track

Usage

spiral_track(
  ylim = c(0, 1),
  height = 0.8,
  background = TRUE,
  background_gp = gpar(fill = "#EEEEEE"),
  reverse_y = FALSE,
  gradient = FALSE,
  track_index = current_track_index() + 1
)

Arguments

ylim

Data range of the y-locations.

height

Height of the track. The value can be the fraction of the distance of the two neighbour spiral loops. The value can also be a grid::unit() object.

background

Whether to draw the background of the track, i.e. border and filled color of background.

background_gp

Graphical parameters of the background.

reverse_y

Whether reverse the direction of y-axis (i.e. pointing to the center of the spiral)?

gradient

Whether draw the background in gradient? The value can be a positive integer of the number of gradients from background_gp$fill to white.

track_index

Index of the track.

Details

If the track is already existed, the function simply mark the track as the current track and does nothing else.

Value

No value is returned.

Examples

spiral_initialize()
spiral_track(height = 0.8)

spiral_initialize()
spiral_track(height = 0.4, background_gp = gpar(fill = "red"))
spiral_track(height = 0.2, background_gp = gpar(fill = "green"))
spiral_track(height = 0.1, background_gp = gpar(fill = "blue"))

spiral_initialize()
spiral_track(height = 0.8, gradient = TRUE) # by default 10 gradients

spiral_initialize()
spiral_track(height = 0.8, background_gp = gpar(fill = "red"), gradient = 5)

jokergoo/spiralize documentation built on June 16, 2024, 4:35 a.m.