ly_image_url {rbokeh}R Documentation

Add an "image_url" layer to a Bokeh figure

Description

Renders raster images from URLs at provided coordinates

Usage

ly_image_url(fig, x = NULL, y = NULL, url, w = 10, h = 10,
  data = figure_data(fig), dilate = TRUE, anchor = "top_left",
  angle = 0, w_units = "screen", h_units = "screen", global_alpha = 1,
  retry_attempts = 0, retry_timeout = 0, lgroup = NULL, lname = NULL)

Arguments

fig

Figure to modify.

x

The image x coordinates.

y

The image y coordinates.

url

Values or field name of image URLs.

w, h

Values or field names of width and height of image.

data

An optional data frame, providing the source for inputs x, y, and other properties.

dilate

Logical indicating whether to always round fractional pixel locations in such a way as to make the images bigger. This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush.

anchor

Where the image is anchored to with respect to x and y. One of 'top_left', 'top_center', 'top_right', 'center_left', 'center', 'center_right', 'bottom_left', 'bottom_center', 'bottom_right'.

angle

Values or field name / expression indicating the angle to rotate the image, in radians.

w_units, h_units

One of "screen", "data".

global_alpha

An overall opacity that each image is rendered with (in addition to any inherent alpha values in the image itself).

retry_attempts

Number of attempts to retry loading the images from the specified URL.

retry_timeout

Timeout (in ms) between retry attempts to load the image from the specified URL.

lgroup

Layer group.

lname

Layer name.

See Also

Other layer functions: ly_annular_wedge, ly_annulus, ly_arc, ly_bar, ly_bezier, ly_boxplot, ly_contour, ly_crect, ly_curve, ly_density, ly_hist, ly_image, ly_lines, ly_multi_line, ly_oval, ly_patch, ly_points, ly_polygons, ly_quadratic, ly_quantile, ly_ray, ly_rect, ly_segments, ly_text, ly_wedge

Examples

url <- c("  http://bokeh.pydata.org/en/latest/_static/images/logo.png",
  "http://developer.r-project.org/Logo/Rlogo-4.png")
ss <- seq(0, 2 * pi, length = 13)[-1]
ws <- runif(12, 2.5, 5) * rep(c(1, 0.8), 6)
imgdat <- data.frame(
  x = sin(ss) * 10, y = cos(ss) * 10,
  w = ws, h = ws * rep(c(1, 0.76), 6),
  url = rep(url, 6),
  angle = runif(12, 0, 2 * pi))

figure(xlab = "x", ylab = "y", xlim = c(-12, 12), ylim = c(-12, 12)) %>%
  ly_image_url(x, y, w = w, h = h, url = url, data = imgdat,
    anchor = "center", global_alpha = 0.5)

[Package rbokeh version 0.6.3 Index]