display_svg {svgtools}R Documentation

Display SVG on standard graphic display port

Description

Display SVG on standard graphic display port

Usage

display_svg(svg, width = NULL, height = NULL)

Arguments

svg

XML document with SVG content.

width

Desired width (in px) of image (default NULL).

height

Desired height (in px) of image (default NULL).

Details

Viewport depends on system and IDE. In RStudio the image is displayed under 'Viewer'.
If neither width nor height are specified the image will have its size depending on DPI settings. If only one of these is specified, the other one is scaled accordingly.

Examples

#read SVG file
fpath <- system.file("extdata", "fig1.svg", package="svgtools")
svg <- read_svg(file = fpath)

#display SVG file in standard viewport
display_svg(svg = svg, width = 500)

[Package svgtools version 1.1.0 Index]