display_svg: Display SVG on standard graphic display port

Description Usage Arguments Details Examples

View source: R/svgtools.R

Description

Display SVG on standard graphic display port

Usage

1

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

1
2
3
4
5
6
#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)

svgtools documentation built on Dec. 14, 2021, 5:10 p.m.