spiral_raster: Add image to a track

Description Usage Arguments Details Value Examples

View source: R/graphics.R

Description

Add image to a track

Usage

1
2
3
spiral_raster(x, y, image, width = NULL, height = NULL,
    facing = c("downward", "inside", "outside", "curved_inside", "curved_outside"),
    nice_facing = FALSE, scaling = 1, track_index = current_track_index())

Arguments

x

X-locations of the center of the image.

y

Y-locations of the center of the image.

image

A vector of file paths of images. The format of the image is inferred from the suffix name of the image file. NA value or empty string means no image to drawn. Supported formats are png/svg/pdf/eps/jpeg/jpg/tiff.

width

Width of the image. See Details.

height

Height of the image. See Details.

facing

Facing of the image.

nice_facing

Whether to adjust the facing.

scaling

Scaling factor when facing is set to "curved_inside" or "curved_outside".

track_index

Index of the track.

Details

When facing is set to one of "downward", "inside" and "outside", both of width and height should be unit objects. It is suggested to only set one of width and height, the other dimension will be automatically calculated from the aspect ratio of the image.

When facing is set to one of "curved_inside" and "curved_outside", the value can also be numeric, which are the values measured in the data coordinates. Note when the segment in the spiral that corresponds to width is very long, drawing the curved image will be very slow because each pixel is actually treated as a single rectangle.

Value

No value is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
image = system.file("extdata", "Rlogo.png", package = "circlize")
x = seq(0.1, 0.9, length = 10)

spiral_initialize()
spiral_track()
spiral_raster(x, 0.5, image)

spiral_initialize()
spiral_track()
spiral_raster(x, 0.5, image, facing = "inside")

spiralize documentation built on Jan. 16, 2022, 1:06 a.m.