Skip to content

Commit

Permalink
kewl legend
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpoison committed Sep 18, 2024
1 parent 54d5ade commit a997340
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Binary file modified astsa_2.1.tar.gz
Binary file not shown.
7 changes: 4 additions & 3 deletions astsa_build/R/tsplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ tsplot <- function(x, y = NULL, main=NULL, ylab=NULL, xlab='Time', type=NULL,
margins=.25, ncolm=1, byrow=TRUE, nx = NULL, ny = nx,
minor=TRUE, nxm=2, nym=1, xm.grid=TRUE, ym.grid=TRUE, col=1,
gg=FALSE, spaghetti=FALSE, pch=NULL, lty=1, lwd=1, mgpp=0,
topper=NULL, addLegend=FALSE, location='topright', horiz=FALSE,
...)
topper=NULL, addLegend=FALSE, location='topright', boxit=TRUE,
horiz=FALSE, ...)
{
nser = max(NCOL(x), NCOL(y))
if (is.null(topper)){
Expand Down Expand Up @@ -113,7 +113,8 @@ tsplot <- function(x, y = NULL, main=NULL, ylab=NULL, xlab='Time', type=NULL,
namez = colnames(as.matrix(y))
}
if (gg) { box.col=gray(1,.7); bg=gray(.92,.8) } else { box.col=gray(.62,.3); bg=gray(1,.8) }
legend(location, legend=namez, lty=lty, col=col, bty='o', box.col=box.col, bg=bg,
if (boxit) bty='o' else bty='n'
legend(location, legend=namez, lty=lty, col=col, bty=bty, box.col=box.col, bg=bg,
lwd=lwd, pch=pch, horiz=horiz, cex=.9)
}
if (gg) { box(col=gray(1)) } else { box(col=gray(.62)) }
Expand Down
9 changes: 6 additions & 3 deletions astsa_build/man/tsplot.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tsplot(x, y=NULL, main=NULL, ylab=NULL, xlab='Time', type=NULL, margins=.25,
ncolm=1, byrow=TRUE, nx=NULL, ny=nx, minor=TRUE, nxm=2, nym=1,
xm.grid=TRUE, ym.grid=TRUE, col=1, gg=FALSE, spaghetti=FALSE, pch=NULL,
lty=1, lwd=1, mgpp=0, topper=NULL, addLegend=FALSE, location='topright',
horiz=FALSE, ...)
boxit=TRUE, horiz=FALSE, ...)
}
\arguments{
\item{x, y}{
Expand Down Expand Up @@ -79,9 +79,12 @@ non-negative value to add to the top outer margin; if NULL (default) a suitable
if \code{addLegend=TRUE}, the location of the legend with options \code{"bottomright"}, \code{"bottom"}, \code{"bottomleft"}, \code{"left"}, \code{"topleft"}, \code{"top"}, \code{"topright"} (the default), \code{"right"} and \code{"center"}.
}
\item{horiz}{
if \code{addLegend=TRUE}, should the legend be horizontal (default is FALSE - vertical)
if \code{addLegend=TRUE}, should the legend be horizontal (default is FALSE - vertical).
}
\item{\dots}{
\item{boxit}{
if TRUE (default), the legend is in a box; if FALSE, no box is drawn.
}
\item{\dots}{
other graphical parameteres; see \link[graphics]{par}.
}
}
Expand Down

0 comments on commit a997340

Please sign in to comment.