[CHNOSZ-commits] r362 - in pkg/CHNOSZ: . demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 22 09:56:26 CET 2019


Author: jedick
Date: 2019-01-22 09:56:26 +0100 (Tue, 22 Jan 2019)
New Revision: 362

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/demo/DEW.R
   pkg/CHNOSZ/demo/Shh.R
   pkg/CHNOSZ/demo/TCA.R
   pkg/CHNOSZ/demo/activity_ratios.R
   pkg/CHNOSZ/demo/adenine.R
   pkg/CHNOSZ/demo/bison.R
   pkg/CHNOSZ/demo/go-IU.R
   pkg/CHNOSZ/demo/gold.R
   pkg/CHNOSZ/demo/lambda.R
   pkg/CHNOSZ/demo/solubility.R
   pkg/CHNOSZ/demo/yeastgfp.R
Log:
demos: clean up par() settings


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/DESCRIPTION	2019-01-22 08:56:26 UTC (rev 362)
@@ -1,6 +1,6 @@
-Date: 2019-01-21
+Date: 2019-01-22
 Package: CHNOSZ
-Version: 1.1.3-69
+Version: 1.1.3-70
 Title: Thermodynamic Calculations and Diagrams for Geo(bio)chemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/demo/DEW.R
===================================================================
--- pkg/CHNOSZ/demo/DEW.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/DEW.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -1,7 +1,7 @@
 # demo for the Deep Earth Water (DEW) model in CHNOSZ 20170927
 
 # set up subplots
-par(mfrow = c(2, 2), mar=c(3.0, 3.5, 2.5, 1.0), mgp=c(1.7, 0.3, 0), las=1, tcl=0.3, xaxs="i", yaxs="i")
+opar <- par(mfrow = c(2, 2), mar=c(3.0, 3.5, 2.5, 1.0), mgp=c(1.7, 0.3, 0), las=1, tcl=0.3, xaxs="i", yaxs="i")
 
 # activate DEW model
 oldwat <- water("DEW")
@@ -213,3 +213,5 @@
 data(OBIGT)
 water(oldwat)
 ###########
+
+par(opar)

Modified: pkg/CHNOSZ/demo/Shh.R
===================================================================
--- pkg/CHNOSZ/demo/Shh.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/Shh.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -45,6 +45,7 @@
 ylab <- expression(bold(A)/2.303*italic(RT)*" vs Shh")
 xlab <- expression(log*italic(a)[H[2]][O])
 # set up normal plot, or plot with interpretive drawings
+opar <- par(no.readonly = TRUE)
 if(interp) {
   if(pdf) pdf("tfactor_interp.pdf", width=6, height=6)
   plot.new()
@@ -194,4 +195,5 @@
   mtext(expression(log*italic(f)[O[2]]), line=2)
 }
 # all done!
+par(opar)
 if(pdf) dev.off()

Modified: pkg/CHNOSZ/demo/TCA.R
===================================================================
--- pkg/CHNOSZ/demo/TCA.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/TCA.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -69,7 +69,7 @@
     substitute(3*co2 + 4*nred + 2*hplus + atp + h2 * "           ", sublist))
 )
 # set up plot
-par(mfrow=c(3, 3))
+opar <- par(mfrow=c(3, 3))
 ylims <- list(
   c(-10, 45), c(1, 6),   c(-2.5, 7.5),
   c(-35, 5),  c(-9, 5),  c(5, 28),
@@ -92,6 +92,7 @@
   else mtitle(as.expression(rtitle[[i]]), line=0.4, cex=0.8)
 }
 # make an overall title
-opar <- par(xpd=NA)
+par(xpd=NA)
 text(-70, 284, "Citric Acid Cycle, after Canovas and Shock, 2016", font=2, cex=1.5)
+par(xpd=FALSE)
 par(opar)

Modified: pkg/CHNOSZ/demo/activity_ratios.R
===================================================================
--- pkg/CHNOSZ/demo/activity_ratios.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/activity_ratios.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -2,7 +2,7 @@
 ## These are made with pH = 0 (activity of H+ = 1), so (activity of the ion) is equal to
 ## (activity of the ion) / [(activity of H+) ^ (charge of the ion)]
 
-par(mfrow = c(2, 2))
+opar <- par(mfrow = c(2, 2))
 res <- 200
 fill <- "terrain"
 
@@ -62,3 +62,5 @@
 diagram(a, add = TRUE, col = "blue", col.names = "blue")
 title(main = syslab(c("CaO", "Al2O3", "MgO", "SiO2", "H2O")))
 legend("topright", describe.property(c("T", "P"), c(300, 500)), bty = "n")
+
+par(opar)

Modified: pkg/CHNOSZ/demo/adenine.R
===================================================================
--- pkg/CHNOSZ/demo/adenine.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/adenine.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -39,6 +39,7 @@
 TK <- seq(275, 425)
 P <- water("Psat", TK)$Psat
 # set up plots
+opar <- par(no.readonly = TRUE)
 layout(matrix(1:3), heights=c(1, 8, 8))
 # title at top
 par(mar=c(0, 0, 0, 0), cex=1)
@@ -116,3 +117,5 @@
 )
 # reset database and computational settings
 data(thermo)
+
+par(opar)

Modified: pkg/CHNOSZ/demo/bison.R
===================================================================
--- pkg/CHNOSZ/demo/bison.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/bison.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -2,7 +2,8 @@
 # average oxidation state of carbon (ZC) of metagenome-derived
 # proteins in different microbial phyla at Bison Pool  20171217
 
-par(mar=c(3.5, 4, 2.5, 2), las=1, mgp=c(2.2, 0.8, 0))
+# set default xaxs, yaxs, and tcl here becuase they are affected by previous demos
+par(mar=c(3.5, 4, 2.5, 2), las=1, mgp=c(2.2, 0.8, 0), xaxs="r", yaxs="r", tcl=-0.5)
 # read the amino acid compositions
 aa.annot <- read.csv(system.file("extdata/protein/DS11.csv", package="CHNOSZ"), as.is=TRUE)
 aa.phyla <- read.csv(system.file("extdata/protein/DS13.csv", package="CHNOSZ"), as.is=TRUE)

Modified: pkg/CHNOSZ/demo/go-IU.R
===================================================================
--- pkg/CHNOSZ/demo/go-IU.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/go-IU.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -3,7 +3,7 @@
 # (BL = Bloomington campus of Indiana University)
 
 ## set up plotting area
-par(mfrow=c(2, 2))
+opar <- par(mfrow=c(2, 2))
 
 ## start with default database
 data(thermo)
@@ -153,3 +153,5 @@
 ### clean up: restore thermodynamic database to default
 ###########
 data(thermo)
+
+par(opar)

Modified: pkg/CHNOSZ/demo/gold.R
===================================================================
--- pkg/CHNOSZ/demo/gold.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/gold.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -201,8 +201,9 @@
 }
 
 # make plots
-par(mfrow=c(2, 2))
+opar <- par(mfrow=c(2, 2))
 Au_pH1()
 Au_pH2()
 Au_T1()
 Au_T2()
+par(opar)

Modified: pkg/CHNOSZ/demo/lambda.R
===================================================================
--- pkg/CHNOSZ/demo/lambda.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/lambda.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -1,11 +1,12 @@
 # plot effects of lambda transition in quartz
 # after Berman 1988 Figs. 1 and 2
+opar <- par(no.readonly = TRUE)
 layout(matrix(c(1, 4:2, 1, 7:5), nrow=4), heights=c(0.7, 3, 3, 3))
 # plot title first
 par(mar=c(0, 0, 0, 0))
 plot.new()
 text(0.5, 0.5, "Effects of lambda transition in quartz, after Berman (1988) Figs. 1 and 2", cex=1.8)
-opar <- par(mar=c(4, 4.5, 1, 0.5), cex=0.8)
+par(mar=c(4, 4.5, 1, 0.5), cex=0.8)
 
 TC <- 0:1200
 T <- convert(TC, "K")

Modified: pkg/CHNOSZ/demo/solubility.R
===================================================================
--- pkg/CHNOSZ/demo/solubility.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/solubility.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -10,6 +10,7 @@
 # Manning et al., 2013, Reviews in Mineralogy & Geochemistry, v. 75, pp. 109-148
 # (doi: 10.2138/rmg.2013.75.5)
 
+opar <- par(no.readonly = TRUE)
 layout(matrix(1:4, nrow = 2))
 
 # set pH and T range and resolution, constant temperature and ionic strength
@@ -67,3 +68,5 @@
 s <- solubility(a)
 diagram(s, type = "loga.balance")
 title(main = "Solubility of calcite", font.main = 1)
+
+par(opar)

Modified: pkg/CHNOSZ/demo/yeastgfp.R
===================================================================
--- pkg/CHNOSZ/demo/yeastgfp.R	2019-01-21 15:40:26 UTC (rev 361)
+++ pkg/CHNOSZ/demo/yeastgfp.R	2019-01-22 08:56:26 UTC (rev 362)
@@ -27,8 +27,9 @@
 species(names, "Sce")
 a <- affinity(H2O=c(-5, 0, 256), O2=c(-80, -66, 256))
 # setup the plot
+opar <- par(no.readonly = TRUE)
 layout(matrix(c(1, 1,2:7), byrow=TRUE, nrow=4), heights=c(0.7, 3, 3, 3))
-opar <- par(mar=c(0, 0, 0, 0))
+par(mar=c(0, 0, 0, 0))
 plot.new()
 text(0.5, 0.7, expression("Proteins in subcellular locations of"~italic("S. cerevisiae")~"(Dick, 2009)"), cex=1.5)
 text(0.5, 0.2, describe.basis(ibasis=c(1, 3, 4, 6), oneline=TRUE), cex=1.5)



More information about the CHNOSZ-commits mailing list