spiral_raster | R Documentation |
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 |
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 |
track_index |
Index of the track. |
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.
No value is returned.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.