[Robast-commits] r247 - in branches/robast-0.7/pkg/RobAStBase: R chm man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 28 09:48:47 CET 2009
Author: ruckdeschel
Date: 2009-01-28 09:48:47 +0100 (Wed, 28 Jan 2009)
New Revision: 247
Modified:
branches/robast-0.7/pkg/RobAStBase/R/comparePlot.R
branches/robast-0.7/pkg/RobAStBase/R/infoPlot.R
branches/robast-0.7/pkg/RobAStBase/chm/RobAStBase.chm
branches/robast-0.7/pkg/RobAStBase/chm/comparePlot.html
branches/robast-0.7/pkg/RobAStBase/chm/infoPlot.html
branches/robast-0.7/pkg/RobAStBase/man/comparePlot.Rd
branches/robast-0.7/pkg/RobAStBase/man/infoPlot.Rd
Log:
infoPlot and comparePlot now have a placeable legend location - argument
Modified: branches/robast-0.7/pkg/RobAStBase/R/comparePlot.R
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/R/comparePlot.R 2009-01-28 07:53:50 UTC (rev 246)
+++ branches/robast-0.7/pkg/RobAStBase/R/comparePlot.R 2009-01-28 08:48:47 UTC (rev 247)
@@ -5,6 +5,7 @@
col = par("col"), lwd = par("lwd"), lty,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
+ legend.location = "bottomright",
mfColRow = TRUE, to.draw.arg = NULL){
xc1 <- as.character(deparse(match.call(call = sys.call(sys.parent(1)))$obj1))
@@ -260,7 +261,7 @@
line = lineT, cex.main = cex.inner, col.main = col.inner))
}
- legend("bottomright", legend = xc, col = col,
+ legend(legend.location, legend = xc, col = col,
cex = 0.75, lwd = lwd*1.5, lty = lty)
if(!hasArg(cex.main)) cex.main <- par("cex.main") else cex.main <- dots$"cex.main"
Modified: branches/robast-0.7/pkg/RobAStBase/R/infoPlot.R
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/R/infoPlot.R 2009-01-28 07:53:50 UTC (rev 246)
+++ branches/robast-0.7/pkg/RobAStBase/R/infoPlot.R 2009-01-28 08:48:47 UTC (rev 247)
@@ -5,6 +5,7 @@
main = FALSE, inner = TRUE, sub = FALSE,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
+ legend.location = "bottomright",
mfColRow = TRUE, to.draw.arg = NULL){
objectc <- match.call(call = sys.call(sys.parent(1)))$object
@@ -39,7 +40,16 @@
dims0 <- length(to.draw1)
nrows <- trunc(sqrt(dims0))
ncols <- ceiling(dims0/nrows)
+ in1to.draw <- (1%in%to.draw)
+ if(missing(legend.location)){
+ legend.location <- distr:::.fillList(list("topright"), dims0+in1to.draw )
+ if (in1to.draw) legend.location[[1]] <- "bottomright"
+ }else{
+ legend.location <- as.list(legend.location)
+ legend.location <- distr:::.fillList(legend.location, dims0+in1to.draw )
+ }
+
e1 <- L2Fam at distribution
if(!is(e1, "UnivariateDistribution") | is(e1, "CondDistribution"))
stop("not yet implemented")
@@ -77,9 +87,9 @@
}
ylim <- eval(dots$ylim)
if(!is.null(ylim)){
- if(!length(ylim) %in% c(2,2*(dims0+(1%in%to.draw))))
+ if(!length(ylim) %in% c(2,2*(dims0+in1to.draw)))
stop("Wrong length of Argument ylim");
- ylim <- matrix(ylim, nrow=2,ncol=dims0+(1%in%to.draw))
+ ylim <- matrix(ylim, nrow=2,ncol=dims0+in1to.draw)
dots$ylim <- NULL
}
@@ -225,7 +235,7 @@
xlab = "x", ylab = "absolute information"), dotsP))
do.call(lines, args=c(list(x.vec, absInfo, type = plty,
lty = lty, lwd = lwd, col = col), dotsL))
- legend("top",
+ legend(legend.location[[1]],
legend = c("class. opt. IC", objectc),
lty = c(ltyI, lty), col = c(colI, col),
lwd = c(lwdI, lwd), cex = 0.75)
@@ -257,7 +267,7 @@
for(i in 1:dims0){
indi <- to.draw1[i]-1
if(!is.null(ylim))
- dotsP$ylim <- ylim[,(1%in%to.draw)+i]
+ dotsP$ylim <- ylim[,in1to.draw+i]
else dotsP$ylim <- c(0,1)
y.vec <- sapply(x.vec, IC1.i.5 at Map[[indi]])^2/absInfo
do.call(plot, args=c(list(x.vec, y.vec, type = plty,
@@ -266,15 +276,16 @@
col = col, lwd = lwd), dotsP))
yc.vec <- sapply(x.vec, classIC.i.5 at Map[[indi]])^2/absInfoClass
- do.call(lines, args=c(list(x.vec, yc.vec, type = plty,
+ do.call(lines, args = c(list(x.vec, yc.vec, type = plty,
lty = ltyI, col = colI, lwd = lwdI), dotsL))
- legend("topright",
+ legend(legend.location[[i+in1to.draw]],
legend = c("class. opt. IC", objectc),
- col = c(colI, col), lwd = c(lwdI, lwd),
- lty = c(ltyI, lty), cex = 0.6)
+ col = c(colI, col), lwd = c(lwdI, lwd),
+ lty = c(ltyI, lty), cex = 0.6)
if(innerL)
- do.call(title, args=c(list(main = innerT[[1+indi]]), dotsT,
- line = lineT, cex.main = cex.inner, col.main = col.inner))
+ do.call(title, args = c(list(main = innerT[[1+indi]]),
+ dotsT, line = lineT, cex.main = cex.inner,
+ col.main = col.inner))
}
}
if(!hasArg(cex.main)) cex.main <- par("cex.main") else cex.main <- dots$"cex.main"
Modified: branches/robast-0.7/pkg/RobAStBase/chm/RobAStBase.chm
===================================================================
(Binary files differ)
Modified: branches/robast-0.7/pkg/RobAStBase/chm/comparePlot.html
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/chm/comparePlot.html 2009-01-28 07:53:50 UTC (rev 246)
+++ branches/robast-0.7/pkg/RobAStBase/chm/comparePlot.html 2009-01-28 08:48:47 UTC (rev 247)
@@ -33,6 +33,7 @@
col = par("col"), lwd = par("lwd"), lty,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
+ legend.location = "bottomright",
mfColRow = TRUE, to.draw.arg = NULL)
</pre>
@@ -96,6 +97,11 @@
<tr valign="top"><td><code>col.inner</code></td>
<td>
character or integer code; color for the inner title</td></tr>
+<tr valign="top"><td><code>legend.location</code></td>
+<td>
+a valid argument <code>x</code> for <code><a onclick="findlink('PerformanceAnalytics', 'PerformanceAnalytics-internal.html')" style="text-decoration: underline; color: blue; cursor: hand">legend</a></code> —
+the place where to put the legend on the last issued
+plot</td></tr>
<tr valign="top"><td><code>mfColRow</code></td>
<td>
shall default partition in panels be used — defaults to <code>TRUE</code></td></tr>
Modified: branches/robast-0.7/pkg/RobAStBase/chm/infoPlot.html
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/chm/infoPlot.html 2009-01-28 07:53:50 UTC (rev 246)
+++ branches/robast-0.7/pkg/RobAStBase/chm/infoPlot.html 2009-01-28 08:48:47 UTC (rev 247)
@@ -97,6 +97,12 @@
<tr valign="top"><td><code>col.inner</code></td>
<td>
character or integer code; color for the inner title</td></tr>
+<tr valign="top"><td><code>legend.location</code></td>
+<td>
+a valid argument <code>x</code> for <code><a onclick="findlink('PerformanceAnalytics', 'PerformanceAnalytics-internal.html')" style="text-decoration: underline; color: blue; cursor: hand">legend</a></code> —
+the place where to put the legend on the last issued
+plot — or a list of length (number of plotted panels)
+of such arguments, one for each plotted panel.</td></tr>
<tr valign="top"><td><code>mfColRow</code></td>
<td>
shall default partition in panels be used — defaults to <code>TRUE</code></td></tr>
Modified: branches/robast-0.7/pkg/RobAStBase/man/comparePlot.Rd
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/man/comparePlot.Rd 2009-01-28 07:53:50 UTC (rev 246)
+++ branches/robast-0.7/pkg/RobAStBase/man/comparePlot.Rd 2009-01-28 08:48:47 UTC (rev 247)
@@ -16,6 +16,7 @@
col = par("col"), lwd = par("lwd"), lty,
col.inner = par("col.main"), cex.inner = 0.8,
bmar = par("mar")[1], tmar = par("mar")[3],
+ legend.location = "bottomright",
mfColRow = TRUE, to.draw.arg = NULL)
}
\arguments{
@@ -45,6 +46,9 @@
to the current setting of \code{cex}; as in
\code{\link[stats]{par}}}
\item{col.inner}{character or integer code; color for the inner title}
+ \item{legend.location}{a valid argument \code{x} for \code{\link{legend}} ---
+ the place where to put the legend on the last issued
+ plot}
\item{mfColRow}{shall default partition in panels be used --- defaults to \code{TRUE}}
\item{to.draw.arg}{if \code{mfColRow==FALSE}, either \code{NULL} (default;
everything is plotted) or a vector of either integers
Modified: branches/robast-0.7/pkg/RobAStBase/man/infoPlot.Rd
===================================================================
--- branches/robast-0.7/pkg/RobAStBase/man/infoPlot.Rd 2009-01-28 07:53:50 UTC (rev 246)
+++ branches/robast-0.7/pkg/RobAStBase/man/infoPlot.Rd 2009-01-28 08:48:47 UTC (rev 247)
@@ -45,6 +45,10 @@
to the current setting of \code{cex}; as in
\code{\link[stats]{par}}}
\item{col.inner}{character or integer code; color for the inner title}
+ \item{legend.location}{a valid argument \code{x} for \code{\link{legend}} ---
+ the place where to put the legend on the last issued
+ plot --- or a list of length (number of plotted panels)
+ of such arguments, one for each plotted panel.}
\item{mfColRow}{shall default partition in panels be used --- defaults to \code{TRUE}}
\item{to.draw.arg}{if \code{mfColRow==FALSE}, either \code{NULL} (default;
everything is plotted) or a vector making a selection
More information about the Robast-commits
mailing list