Skip to content

Commit c88f8c4

Browse files
author
NorNet Praesum Presum
committed
Plotting fix.
1 parent 672a46b commit c88f8c4

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/plotter.R

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -873,16 +873,18 @@ plotstd3 <- function(mainTitle,
873873
legendColors <- par("fg")
874874
legendBackground <- "white"
875875
}
876-
legend(lx, ly,
877-
xjust = lxjust,
878-
yjust = lyjust,
879-
parse(text=legendTexts),
880-
bg=legendBackground,
881-
col=legendColors,
882-
lty=legendStyles,
883-
pch=legendDots,
884-
text.col=legendColors,
885-
lwd=1, cex=par("cex")*legendSize)
876+
if(length(legendTexts) > 1) {
877+
legend(lx, ly,
878+
xjust = lxjust,
879+
yjust = lyjust,
880+
parse(text=legendTexts),
881+
bg=legendBackground,
882+
col=legendColors,
883+
lty=legendStyles,
884+
pch=legendDots,
885+
text.col=legendColors,
886+
lwd=1, cex=par("cex")*legendSize)
887+
}
886888
}
887889

888890
par(opar)

0 commit comments

Comments
 (0)