[Dplr-commits] r888 - in pkg/dplR: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 19 16:57:16 CEST 2014


Author: mvkorpel
Date: 2014-05-19 16:57:15 +0200 (Mon, 19 May 2014)
New Revision: 888

Modified:
   pkg/dplR/ChangeLog
   pkg/dplR/R/skel.plot.R
Log:
Fixed issues with clipping and alignment in skel.plot().


Modified: pkg/dplR/ChangeLog
===================================================================
--- pkg/dplR/ChangeLog	2014-05-19 13:48:35 UTC (rev 887)
+++ pkg/dplR/ChangeLog	2014-05-19 14:57:15 UTC (rev 888)
@@ -90,6 +90,13 @@
 
 - Fixed clipping of text in the lower right corner of the plot
 
+File: skel.plot.R
+-----------------
+
+- Adjusted alignment, size and clipping properties of viewports.  Now a
+  plot with less than the full number of rows can fit in a smaller
+  device and text on the sides won't be clipped.
+
 File: timeseries-dplR.Rnw
 -------------------------
 

Modified: pkg/dplR/R/skel.plot.R
===================================================================
--- pkg/dplR/R/skel.plot.R	2014-05-19 13:48:35 UTC (rev 887)
+++ pkg/dplR/R/skel.plot.R	2014-05-19 14:57:15 UTC (rev 888)
@@ -68,7 +68,7 @@
 
     ## Variables for plotting
     ## page width
-    pw <- 254
+    pw <- 278
     ## page height
     ph <- 178
     ## row height
@@ -92,8 +92,7 @@
         for (i in m) {
             y <- y - (rh + spcr)
             vps[[i]] <-
-                viewport(x=unit(3, "mm"),
-                         y=unit(y, "mm"),
+                viewport(x=unit(19, "mm"), y=unit(y, "mm"),
                          width=unit(246, "mm"), height=unit(rh, "mm"),
                          just=c("left", "bottom"), name=LETTERS[i])
         }
@@ -147,8 +146,9 @@
         ## set up page with the right number of rows
         dev.hold()
         on.exit(dev.flush())
-        pushViewport(vpTree(viewport(width=unit(pw, "mm"),
-                                     height=unit(ph, "mm"), name="page"),
+        pushViewport(vpTree(viewport(width=unit(pw, "mm"), y=1, just="top",
+                                     height=unit(ph, "mm"), name="page",
+                                     clip="off"),
                             do.call(vpList, vps)))
         row.last <- 0
         for (i in m) {



More information about the Dplr-commits mailing list