Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
13  runs/equilibrium/plot-visits.r
@@ -81,12 +81,13 @@ pushViewport(viewport(x=0.97, y=0.97, just=c(1,1), height=0.8, width=0.8,
81 81
   grid.text("density", y=0.5, x=-0.15, rot=90, gp=gpar(cex=1.0))
82 82
 popViewport()
83 83
 # plot a legend
84  
-pushViewport(viewport(x=0.97, y=0.97, just=c(1,1), height=0.3, width=0.2))
85  
-  mutation.o <- order(as.numeric(mutation.rates))
86  
-  legend.y <- seq(0, 0.8, length.out=length(sets))
87  
-  grid.points(x=rep(0, length(sets)), y=legend.y, size=unit(0.4, "char"), pch=21, gp=gpar(col=(1:length(sets))[mutation.o]))
88  
-  grid.text(mutation.rates[mutation.o], x=0.1, just=c(0,0.5), y=legend.y, gp=gpar(cex=0.8, fontfamily="mono"))
89  
-  grid.text("mutation rate", x=0, y=1, just=c(0,0.5))
  84
+pushViewport(viewport(x=0.90, y=0.99, just=c(1,1), height=0.33, width=0.1))
  85
+  mutation.o <- order(as.numeric(mutation.rates * 2*N))
  86
+  legend.y <- seq(0, 0.75, length.out=length(sets))
  87
+  grid.points(x=rep(0.2, length(sets)), y=legend.y, size=unit(0.4, "char"), pch=21, gp=gpar(col=(1:length(sets))[mutation.o]))
  88
+  grid.text(mutation.rates[mutation.o], x=0.3, just=c(0,0.5), y=legend.y, gp=gpar(cex=0.8, fontfamily="mono"))
  89
+  grid.text("mutations entering", x=0.5, y=1, just=c(0.5,1), gp=gpar(cex=0.9))
  90
+  grid.text("population per gen.", x=0.5, y=0.9, just=c(0.5,1), gp=gpar(cex=0.9))
90 91
 popViewport()
91 92
 dev.off()
92 93
 
28  src/r/standard_plot.r
... ...
@@ -0,0 +1,28 @@
  1
+#!/usr/bin/Rscript
  2
+
  3
+# load arguments
  4
+the.args <- commandArgs()
  5
+script <- sub("--file=", "", the.args[grep("--file=", the.args)])
  6
+run.file <- sub("--data=", "", the.args[grep("--data=", the.args)])
  7
+pdf.file <- sub("--pdf=", "", the.args[grep("--pdf=", the.args)])
  8
+
  9
+# check args
  10
+stopifnot(length(run.file) == 1)
  11
+stopifnot(length(script) == 1)
  12
+stopifnot(length(grep("/standard_plot.r$", script)) == 1)
  13
+
  14
+# load library
  15
+script.dir <- sub("/standard_plot.r", "", script)
  16
+source(paste(script.dir, "/evolveq.R", sep=""))
  17
+
  18
+# assume a name for a pdf file if none is given
  19
+if (length(pdf.file) == 0) {
  20
+  base.name <- sub("\\.out(\\.gz)*", "", run.file)
  21
+  pdf.file <- paste(base.name, ".pdf", sep="")
  22
+}
  23
+
  24
+# load the data plot the run
  25
+run <- load.simoutput(run.file)
  26
+plot.freqs(run, pdf.file=pdf.file, resolution=500)
  27
+
  28
+# END

No commit comments for this range

Something went wrong with that request. Please try again.