plotAsp: Construct a Plot with a Specified Aspect Ratio

Description Usage Arguments Details Author(s) Examples

View source: R/plotFuns.r

Description

Plot x and y coordinates using a specified aspect ratio.

Usage

1
plotAsp(x, y, asp=1, ...)

Arguments

x

vector of x-coordinate points in the plot.

y

vector of y-coordinate points in the plot.

asp

y/x aspect ratio.

...

additional arguments for plot.

Details

The function plotAsp differs from plot(x,y,asp=1) in the way axis limits are handled. Rather than expand the range, plotAsp expands the margins through padding to keep the aspect ratio accurate.

Author(s)

Alex Couture-Beil, Vancouver Island University, Nanaimo BC

Examples

1
2
3
4
5
6
7
8
9
local(envir=.PBSmodEnv,expr={
  oldpar = par(no.readonly=TRUE)
  x <- seq(0,10,0.1)
  y <- sin(x)
  par(mfrow=2:1)
  plotAsp(x,y,asp=1,xlim=c(0,10),ylim=c(-2,2), main="sin(x)")
  plotAsp(x,y^2,asp=1,xlim=c(0,10),ylim=c(-2,2), main="sin^2(x)")
  par(oldpar)
})

PBSmodelling documentation built on Dec. 27, 2017, 5:03 p.m.