Skip to contents

Render pic source to a PNG file

Usage

rpic_png(src, file, scale = 2, circuits = NULL, texlabels = NULL)

Arguments

src

pic source code: a pic() object or a single string.

file

output path.

scale

raster scale (1 = 96 dpi).

circuits

load the native circuit-element library (or write copy "circuits" in the source itself). NULL (the default) takes the pic() object's setting, FALSE for a string.

texlabels

typeset fully $...$-delimited labels as TeX math (initializer only — the source can still set texlabels = 0). NULL (the default) takes the pic() object's setting, FALSE for a string.

Value

the file path, invisibly.

Examples

png <- tempfile(fileext = ".png")
pic('box "hi"; arrow; circle "x"') |> rpic_png(png)