Image glyphs are useful to show pictures or other sophisticated compound glyphs. Note that images in the Tk canvas support transparancy.

l_glyph_add_image(widget, images, label = "", ...)

Arguments

widget

widget path as a string or as an object handle

images

Tk image references, see the l_image_import_array and l_image_import_files helper functions.

label

label of a glyph (currently shown only in the glyph inspector)

...

state arguments

Details

For more information run: l_help("learn_R_display_plot.html#images")

See also

Examples

if(interactive()){ p <- with(olive, l_plot(palmitic ~ stearic, color = Region)) img_paths <- list.files(file.path(find.package(package = 'loon'), "images"), full.names = TRUE) imgs <- setNames(l_image_import_files(img_paths), tools::file_path_sans_ext(basename(img_paths))) i <- pmatch(gsub("^[[:alpha:]]+-","", olive$Area), names(imgs), duplicates.ok = TRUE) g <- l_glyph_add_image(p, imgs[i], label="Flags") p['glyph'] <- g }