Skip to content

Commit

Permalink
Added mar argument to customize margins
Browse files Browse the repository at this point in the history
Passed to par()
  • Loading branch information
mbojan committed Nov 9, 2016
1 parent 6c56a2d commit dffa0cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion R/alluvial.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#' @param blocks logical, whether to use blocks to tie the flows together at each category, versus contiguous ribbons (also admits character value "bookends")
#' @param ordering list of numeric vectors allowing to reorder the alluvia on each axis separately, see Examples
#' @param axis_labels character, labels of the axes, defaults to variable names in the data
#' @param mar numeric, plot margins as in \code{\link{par}}
#' @param cex,cex.axis numeric, scaling of fonts of category labels and axis labels respectively. See \code{\link{par}}.
#'
#' @return Invisibly a list with elements:
Expand All @@ -38,6 +39,7 @@ alluvial <- function( ..., freq,
blocks = TRUE,
ordering=NULL,
axis_labels=NULL,
mar = c(2, 1, 1, 1),
cex=par("cex"),
cex.axis=par("cex.axis"))
{
Expand Down Expand Up @@ -154,7 +156,7 @@ alluvial <- function( ..., freq,
dd <- lapply(seq_along(d), getp, d=d, f=p$freq)
rval <- list( endpoints=dd )
# Plotting
op <- par(mar=c(2, 1, 1, 1))
op <- par(mar=mar)
plot(NULL, type="n", xlim=c(1-cw, np+cw), ylim=c(0, 1), xaxt="n", yaxt="n",
xaxs="i", yaxs="i", xlab='', ylab='', frame=FALSE)
# For every stripe
Expand Down
6 changes: 4 additions & 2 deletions man/alluvial.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dffa0cc

Please sign in to comment.