Learn R Programming

ggpubr (version 0.6.0)

npc_to_data_coord: Convert NPC to Data Coordinates

Description

Convert NPC (Normalized Parent Coordinates) into data coordinates.

Usage

npc_to_data_coord(npc, data.ranges)

Value

a numeric vector representing data coordinates.

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)

See Also

as_npc, get_coord.

Examples

Run this code
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))

Run the code above in your browser using DataLab