Learn R Programming

showtext (version 0.4-1)

showtext.opts: Setting Options for 'showtext' package

Description

This function sets parameters that will affect the apprearance of the graphs created with showtext.

Usage

showtext.opts(...)

Arguments

...
Options to be set, expressed in name = value pairs. It can also be a list containing these pairs (for example, the list returned by a previous call of showtext.opts()). Currently accepted pa

Examples

Run this code
## Set dpi to 200
op = showtext.opts(dpi = 200)

png("dpi_200.png", 800, 800, res = 200)
par(family = "sans")
showtext.begin()

set.seed(123)
plot(density(rnorm(100)))

showtext.end()
dev.off()

## Restore old options
showtext.opts(op)

png("dpi_96.png", 800, 800, res = 96)
par(family = "sans")
showtext.begin()

set.seed(123)
plot(density(rnorm(100)))

showtext.end()
dev.off()

Run the code above in your browser using DataLab