Skip to content

Commit 185542a

Browse files
author
Lindsay Carr
committed
Merge pull request #345 from jread-usgs/master
updates after review
2 parents f2e642d + 39a1f3d commit 185542a

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

R/callouts.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ callouts.gsplot <- function(object, ..., side=c(1,2)){
4040
#' @param labels text to be added to callout
4141
#' @param length relative (percentage of window width and height) distance for callout
4242
#' @param angle callout line angle
43-
#' @param cex passed to text for font size formatting
43+
#' @param cex passed to \code{\link[graphics]{text}} for font size formatting
44+
#' @param lwd passed to \code{\link[graphics]{arrows}} for line weights
45+
#' @param lty passed to \code{\link[graphics]{arrows}} for line type
4446
#'
4547
#' @rdname callouts
4648
#' @export
47-
callouts.default <- function(x, y=NULL, labels=NA, length=0.1, angle='auto', cex=par()$cex, ...){
49+
callouts.default <- function(x, y=NULL, labels=NA, length=0.1, angle='auto', cex=par()$cex, lwd=par()$lwd, lty=par()$lty, ...){
4850

4951
if (is.null(y)) {
5052
warning("y=NULL not currently supported in callouts.default")

R/error_bars.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ error_bar.gsplot <- function(object, x, y, y.high=0, y.low=0, x.high=0, x.low=0,
109109
#' @param \dots additional arguments passed to \code{\link[graphics]{arrows}}
110110
#' @export
111111
#' @keywords internal
112-
error_bar.default <- function(x, y, y.high, y.low, x.high, x.low, epsilon=0.1, ...){
112+
error_bar.default <- function(x, y, y.high, y.low, x.high, x.low, epsilon=0.1, lwd, lty, col, ...){
113113
warning("this function doesn't do anything")
114114
return()
115115
}

R/print.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ print.gsplot <- function(x, ...){
4040
on.exit(dev.flush())
4141
plot.new()
4242
}
43-
43+
4444
par(x$global$par)
4545
i.axis <- which(names(views) %in% 'axis')
4646
defined.sides <- sapply(i.axis, function(x) views[[x]][['arguments']][['side']])
@@ -53,19 +53,20 @@ print.gsplot <- function(x, ...){
5353

5454
for (side.name in side.names){
5555
side <- as.side(side.name)
56-
par(x[[side.name]]$par)
56+
old.par <- par(x[[side.name]]$par)
5757
set_frame(views, side)
5858
if(!side %in% defined.sides){
5959
if(x[[side.name]][['axes']]){
60-
Axis(side=side,x=lim(views, side))
60+
do.call('Axis', append(list(side=side,x=lim(views, side)), config('axis')))
6161
}
6262
} else {
6363
axis <- i.axis[which(defined.sides == side)]
6464
draw_axis(views, index.axis=axis)
6565
}
66-
if(exists('ann', x[[side.name]]$par) && x[[side.name]]$par$ann){
66+
if(par('ann')){
6767
mtext(text=label(views, side), side=side, line = 2, las=config("mtext")$las)
6868
}
69+
par(old.par)
6970
}
7071

7172
for (view.name in view_names(views)){
@@ -106,10 +107,11 @@ print.view <- function(x, ...){
106107
# if(window$frame.plot){
107108
# box()
108109
# }
109-
par(x[['par']])
110+
old.par <- par(x[['par']])
110111

111112
# -- call functions --
112113
to_gsplot(lapply(plots, function(x) x[!(names(x) %in% c('legend.name'))]))
114+
par(old.par)
113115
}
114116

115117
to_gsplot <- function(x){

man/callouts.Rd

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/error_bar.default.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)