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 = "", ...)
widget | widget path as a string or as an object handle |
---|---|
images | Tk image references, see the |
label | label of a glyph (currently shown only in the glyph inspector) |
... | state arguments |
For more information run: l_help("learn_R_display_plot.html#images")
l_glyph_add
, l_image_import_array
,
l_image_import_files
, l_make_glyphs
Other glyph functions:
l_glyph_add.default()
,
l_glyph_add_pointrange()
,
l_glyph_add_polygon()
,
l_glyph_add_serialaxes()
,
l_glyph_add_text()
,
l_glyph_add()
,
l_glyph_delete()
,
l_glyph_getLabel()
,
l_glyph_getType()
,
l_glyph_ids()
,
l_glyph_relabel()
,
l_primitiveGlyphs()
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 }