Skip to content

Commit eb308f8

Browse files
author
Lindsay Carr
committed
missing some logic for type
1 parent ac39945 commit eb308f8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

R/set_args.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ set_legend_args <- function(object, fun.name, ..., legend.name) {
7575
c='lchsS', h='lchsS', s='lchsS', S='lchsS', n='n')
7676
params.needed <- switch(type.name,
7777
p=list(pch=1, pt.bg=quote(par("bg")), pt.cex=par("cex"), pt.lwd=par("lwd"), lty=NA, lwd=NA),
78-
bo=list(pch=1, pt.bg=quote(par("bg")), pt.cex=par("cex"), pt.lwd=par("lwd")),
78+
bo=list(pch=1, pt.bg=quote(par("bg")), pt.cex=par("cex"), pt.lwd=par("lwd"), lty=1, lwd=1),
7979
lchsS=list(pch=NA, lty=1, lwd=1),
8080
n=list(lty=NA, lwd=NA, pch=NA))
8181
paramsAll <- set_type_params(paramsAll, type.name, params.needed)
82+
if(type.name %in% c('p', 'lchsS')) {fun.name <- switch(type.name, p="points", lchsS="lines")}
8283
}
8384

8485
usr.args <- paramsAll[which(names(paramsAll) %in% names(fun.default))]
@@ -118,8 +119,10 @@ set_legend_args <- function(object, fun.name, ..., legend.name) {
118119

119120
set_type_params <- function(list, type.name, params){
120121
for(k in names(params)){
121-
if(type.name == 'n' || is.null(list[[k]])){
122-
list[[k]] <- params[[match(k, names(params))]]
122+
if(type.name == 'p' && k %in% c('lty', 'lwd') ||
123+
type.name == 'lchsS' && k %in% 'pch' ||
124+
type.name == 'n' || is.null(list[[k]])){
125+
list[[k]] <- params[[match(k, names(params))]]
123126
}
124127
}
125128
return(list)

0 commit comments

Comments
 (0)