Learn R Programming

wrGraph (version 1.3.8)

.predPointsPix: Predict and return pixel location of points of current plot

Description

This function allows predicting the pixel location of points of current plot. Note: may be imprecise in case of x or y with all same values.

Usage

.predPointsPix(
  x,
  y,
  dimPng,
  res,
  marg,
  fromTop = TRUE,
  scExt = 0.04,
  displ = FALSE,
  callFrom = NULL,
  silent = FALSE,
  debug = FALSE
)

Value

This function returns a numeric matrix with 2 columns 'xPix' and 'yPix' (with length(x) rows); and optionally a plot (if argument displ=TRUE)

Arguments

x

(numeric) initial coordinates for plot

y

(numeric) initial coordinates for plot

dimPng

(numeric, length=2) width and hight of png

res

(numeric, length=1) resultion of png

marg

(numeric, length=4) margins in inches (as given by par(mar=c(...)))

fromTop

(logical) default counting in html is from top

scExt

(numeric, length=1) extending scale (default at 0.04 ie 4 %)

displ

(logical) optional plot

callFrom

(character) allows easier tracking of messages produced

silent

(logical) suppress messages

debug

(logical) additonal messages for debugging

See Also

convertPlotCoordPix, mouseOverHtmlFile

Examples

Run this code
.predPointsPix(x=c(1,100), y=c(1,100), dimPng=c(700,600), res=200, marg=c(5,4,4,2))

Run the code above in your browser using DataLab