centresvg: Draws a pointsvg object around a given point

View source: R/centresvg.R

centresvgR Documentation

Draws a pointsvg object around a given point

Description

Draws a svg object imported as data frame using pointsvg around a given point.

Usage

centresvg(
  object,
  x,
  y,
  xfac = 1,
  yfac = 1,
  xadj = 0,
  yadj = 0,
  forget = NULL,
  front = NULL,
  back = NULL,
  standard = FALSE,
  keep.ratio = FALSE,
  col = NA,
  border = "black",
  density = NA,
  angle = 45,
  lty = par("lty"),
  lwd = par("lwd"),
  scol = border,
  slty = lty,
  slwd = lwd,
  plot = TRUE,
  output = FALSE
)

centersvg(
  object,
  x,
  y,
  xfac = 1,
  yfac = 1,
  xadj = 0,
  yadj = 0,
  forget = NULL,
  front = NULL,
  back = NULL,
  standard = FALSE,
  keep.ratio = FALSE,
  col = NA,
  border = "black",
  density = NA,
  angle = 45,
  lty = par("lty"),
  lwd = par("lwd"),
  scol = border,
  slty = lty,
  slwd = lwd,
  plot = TRUE,
  output = FALSE
)

Arguments

object

a pointsvg object (svg object imported as data frame using pointsvg).

x, y

numeric vectors of coordinates where the object should be drawn.

xfac

the x size factor.

yfac

the y size factor.

xadj

value specifying the x adjustment of the drawing.

yadj

value specifying the y adjustment of the drawing.

forget

the elements that should be discarded, by their id or index (i.e. name or number of appearance).

front, back

the elements to be put in front and back position, by their id or index (i.e. name or number of appearance). By default the order is the one of the original .svg file.

standard

whether to standardise (centre to (0,0), rescale so that extreme points are at -1 and 1) or not (T or F)

keep.ratio

if the object is to be standardised, whether to keep the x/y ratio (T or F)

col

the polygones background color. If density is specified with a positive value this gives the color of the shading lines.

border

the lines color.

density

the density of shading lines, in lines per inch. The default value of NULL means that no shading lines are drawn.

angle

the slope of shading lines, given as an angle in degrees (counter-clockwise)

lty, lwd

the border line type and width, see ?par for details.

scol, slty, slwd

the colour, type and width of the shading lines.

plot

whether to add to a plot

output

whether to output the new object coordinates

Details

The centresvg and framesvg have a lot of similarities with the multigons function: the graphical parameters are mostly identical. However there is a strong distinction between the -svg functions and multigons: when providing several graphical arguments, multigons will attribute them to each polygon, whereas the .svg functions will use them for each repetition of the .svg object. Using the latter, the graphical parameters will be applied to all the elements of a drawing. If you want a finer personalisation you have to use multigons and multilines (or an hybrid of the two, yet to be coded).

See Also

Similar functions: framesvg and placesvg

Change the drawing: changesvg and clipsvg

Uses ignore to avoid drawing unnecessary objects

Examples

object <- example.ammonite

plot(c(-10,10), c(-10,10), type = "n")

centresvg(object, 5, 5, xfac = 2, yfac = 2,lty = 1,density = 20, angle = 45)

points(5,5,pch = 19, col = "blue")


StratigrapheR documentation built on July 9, 2023, 6:02 p.m.