Last data update: 2014.03.03

R: Transfer relative to actual plot coordinate values
userCoordsR Documentation

Transfer relative to actual plot coordinate values

Description

userCoords transfers realtive coordinate values (i.e. values between 0 and 1) to the actual coordinate system of the plot.

Usage

userCoords(x = c(), y = c())

Arguments

x

numeric vector(0-1): relative coordinates on the x axis

y

numeric vector(0-1): relative coordinates on the y axis

Details

x and y need to be values between 0 and 1. These values are then mapped to the coordinates used in the current plot.

Value

list with x and/or y component with values in the current coordinate system

Author(s)

Jannis v. Buttlar

Examples

plot(1:10)
text.coords <- userCoords(x=c(0.1,0.5),y=c(0.9,0.5))
text(text.coords,labels=c('1st Text','2nd Text'))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(JBTools)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/JBTools/userCoords.Rd_%03d_medium.png", width=480, height=480)
> ### Name: userCoords
> ### Title: Transfer relative to actual plot coordinate values
> ### Aliases: userCoords
> 
> ### ** Examples
> 
> plot(1:10)
> text.coords <- userCoords(x=c(0.1,0.5),y=c(0.9,0.5))
> text(text.coords,labels=c('1st Text','2nd Text'))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>