Add image to a track
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()
)
X-locations of the center of the image.
Y-locations of the center of the 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 of the image. See Details.
Height of the image. See Details.
Facing of the image.
Whether to adjust the facing.
Scaling factor when facing
is set to "curved_inside"
or "curved_outside"
.
Index of the track.
No value is returned.
When facing
is set to one of "downward"
, "inside"
and "outside"
, both of width
and height
should be grid::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.
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")