          .attr("stroke-width", 4)
          .on("mouseover", efftip)
          .on("mouseout", -> d3.selectAll("#efftip").remove())
+
+
+    revPXG = (marker) ->
+      # calculate group averages
+      chr = data.pmark[marker].chr
+      if(chr is "X")
+        means = [0,0,0,0]
+        n = [0,0,0,0]
+        male = [0,0,1,1]
+        genotypes = ["RR", "BR", "BY", "RY"]
+        sexcenter = [(pxgXscaleX(0) + pxgXscaleX(1))/2,
+                     (pxgXscaleX(2) + pxgXscaleX(3))/2]
+      else
+        means = [0,0,0,0,0,0]
+        n = [0,0,0,0,0,0]
+        male = [0,0,0,1,1,1]
+        genotypes = ["BB", "BR", "RR", "BB", "BR", "RR"]
+        sexcenter = [pxgXscaleA(1), pxgXscaleA(4)]
+      for i of data.individuals
+         g = Math.abs(data.geno[marker][i])
+         sx = data.sex[i]
+         if(data.pmark[marker].chr is "X")
+           x = sx*2+g-1
+         else
+           x = sx*3+g-1
+         means[x] += probe_data.pheno[i]
+         n[x]++
+      for i of means
+        means[i] /= n[i]
+
+      d3.selectAll("line.PXGvert")
+         .data(genotypes)
+      d3.selectAll("line.PXGmeans")
+         .data(means)
+      d3.selectAll("text.PXGgeno")
+      d3.selectAll("text.PXGsex")
+         .attr("x", (d, i) -> sexcenter[i])
+
+      d3.selectAll("circle.plotPXG")
+         .transition().duration(1000)
+        .attr("cx", (d,i) -> 
+              g = Math.abs(data.geno[marker][i])
+              sx = data.sex[i]
+              if(data.pmark[marker].chr is "X")
+                return pxgXscaleX(sx*2+g-1)+jitter[i]
+              pxgXscaleA(sx*3+g-1)+jitter[i])
 
   chrindex = {}
   for c,i in data.chrnames

              .data(genotypes)
              .enter()
              .append("text")
              .text((d) -> d)
              .attr("y", bottom[2] + pad.bottom*0.25)
              .attr("x",  (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))

              .data(means)
              .enter()
              .append("line")
              .attr("class", "PXGvert")
              .attr("y1", top[2])
              .attr("y2", bottom[2])
              .attr("x1", (d,i) -> return if(chr is "X") then pxgXscaleX(i) else pxgXscaleA(i))
