ggpmisc (version 0.3.2)

compute_npcx: Compute npc coordinates

Description

Convert character-encoded positions to npc units and shift postions to avoid overlaps when grouping is active. If numeric validate npc values.

Usage

compute_npcx(x, group = 1L, h.step = 0.1, margin.npc = 0.05)

compute_npcy(y, group = 1L, v.step = 0.1, margin.npc = 0.05)

Arguments

x, y

numeric or character vector of coordinates.

group

integer ggplot's group id. Used to shift coordinates to avoid overlaps.

h.step, v.step

numeric [0..1] The step size for shifting coordinates in npc units.

margin.npc

numeric [0..1] The margin added towards the nearest plotting area edge when converting character coordinates into npc.

Value

A numeric vector with values in the range [0..1] representing npc coordinates.