npc_to_data_coord: Convert NPC to Data Coordinates

View source: R/npc_to_data_coord.R

npc_to_data_coordR Documentation

Convert NPC to Data Coordinates

Description

Convert NPC (Normalized Parent Coordinates) into data coordinates.

Usage

npc_to_data_coord(npc, data.ranges)

Arguments

npc

a numeric vector. Each value should be in [0-1]

data.ranges

a numeric vector of length 2 containing the data ranges (minimum and the maximum)

Value

a numeric vector representing data coordinates.

See Also

as_npc, get_coord.

Examples

npc_to_data_coord(npc = c(0.2, 0.95), data.ranges = c(1, 20))
as_npc(c("top", "right")) %>%
   npc_to_data_coord(data.ranges = c(1, 20))


kassambara/ggpubr documentation built on Feb. 15, 2023, 4:09 a.m.