[Analogue-commits] r332 - in pkg: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 4 05:02:26 CEST 2013


Author: gsimpson
Date: 2013-06-04 05:02:25 +0200 (Tue, 04 Jun 2013)
New Revision: 332

Modified:
   pkg/R/Stratiplot.R
   pkg/inst/ChangeLog
   pkg/man/Stratiplot.Rd
Log:
add some extra label handling code

Modified: pkg/R/Stratiplot.R
===================================================================
--- pkg/R/Stratiplot.R	2013-05-22 14:53:45 UTC (rev 331)
+++ pkg/R/Stratiplot.R	2013-06-04 03:02:25 UTC (rev 332)
@@ -19,18 +19,25 @@
                                  zoneNames = NULL,
                                  drawLegend = TRUE,
                                  na.action = "na.omit",
+                                 labelAt = NULL,
+                                 labelRot = 60,
                                  ...) {
     ## inline function for custom axis
     axis.VarLabs <- function(side, ...) {
         if(isTRUE(all.equal(side, "top"))) {
             M <- function(lims) min(lims) + (diff(lims) / 2)
             xlim <- current.panel.limits()$xlim
-            panel.axis(side = side, outside = TRUE, #at = 0,
-                       at = M(xlim),
+            if (is.null(labelAt)) {
+                at <- M(xlim)
+            } else {
+                at <- rep(labelAt, 1)
+            }
+            panel.axis(side = side, outside = TRUE,
+                       at = at,
                        tck = 1, line.col = "black",
                        text.col = "black",
                        labels = levels(sx$ind)[which.packet()],
-                       rot = 60)
+                       rot = labelRot)
         } else {
             axis.default(side = side, ...)
         }

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2013-05-22 14:53:45 UTC (rev 331)
+++ pkg/inst/ChangeLog	2013-06-04 03:02:25 UTC (rev 332)
@@ -19,6 +19,10 @@
 	in species composition. Has both base and Lattice graphics plot
 	methods (the latter via `dotplot()`).
 
+	* Stratiplot: new arguments `labelAt` and `labelRot` allow the
+	placement and rotation variable labels to be controlled, when not
+	using a strip.
+
 Version 0.11-2
 
 	* timetrack: plot method now allows plotting of "lc" or "wa"

Modified: pkg/man/Stratiplot.Rd
===================================================================
--- pkg/man/Stratiplot.Rd	2013-05-22 14:53:45 UTC (rev 331)
+++ pkg/man/Stratiplot.Rd	2013-06-04 03:02:25 UTC (rev 332)
@@ -18,6 +18,7 @@
            svar = NULL, rev.sort = FALSE, strip = FALSE, topPad =6,
            varTypes = "relative", absoluteSize = 0.5,
            zoneNames = NULL, drawLegend = TRUE, na.action = "na.omit",
+           labelAt = NULL, labelRot = 60,
            \dots)
 
 \method{Stratiplot}{formula}(formula, data, subset,
@@ -95,6 +96,14 @@
     to label the zone legend, if drawn (see argument
     \code{drawLegend}). See Details.} 
   \item{drawLegend}{logical; should a legend for the zones}
+  \item{labelAt, labelRot}{these control the placement and rotation,
+    respectively, of the variable labels. \code{labelAt} is the
+    coordinate at which the label is drawn; currently only one value is
+    used so you can't place labels in different locations depending on
+    which panel is drawn. This will be fixed in a future version. The
+    default location for the label is the panel mid-point.
+    \code{labelAt} controls the rotation of the label; it is a numeric
+    value in degree.}
   \item{\dots}{additional arguments passed to
     \code{\link{panel.Stratiplot}} and the underlying
     \code{\link[lattice]{xyplot}} function.}



More information about the Analogue-commits mailing list