
Last chance! 50% off unlimited learning
Sale ends in
Renders raster images from URLs at provided coordinates
ly_image_url(
fig,
x = 0,
y = 0,
data = figure_data(fig),
w = 10,
h = 10,
image_url,
dilate = TRUE,
anchor = "top_left",
angle = 0,
lname = NULL,
lgroup = NULL
)
figure to modify
x coordinates
y coordinates
an optional data frame, providing the source for inputs x, y, and other properties
values or field names of width and height of image
values or field name of image URLs
logical - whether to dilate pixel distance computations when drawing
where the image is anchored to with respect to x
and y
values or field name of the angle to rotate the image, in radians
layer name
layer group
Other layer functions:
ly_abline()
,
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_map()
,
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()
# NOT RUN {
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)
)
p <- figure(xlab = "x", ylab = "y") %>%
ly_image_url(x, y, w = w, h = h, image_url = url, data = imgdat,
anchor = "center") %>%
ly_lines(sin(c(ss, ss[1])) * 10, cos(c(ss, ss[1])) * 10,
width = 15, alpha = 0.1)
p
# }
Run the code above in your browser using DataLab