 
   nTicks = [10, 10, 6, 6]
   nLabels = [6, 6, 6, 6]
-  padMult = [0.15, 0.15, 0.25, 0.05]
   for j in [0..3]
     YaxisGrp[j].selectAll("empty")
                .data(yScale[j].ticks(nTicks[j]))

         .attr("stroke", "black")
         .attr("stroke-width", "2")

  # background rectangles for each chromosome, alternate color
  chrRect = topsvg.append("g").selectAll("empty")
     .data(data.chr)

          .x((d) -> xScale[1][j](d))
          .y((d,i) -> yScale[1](data.lod[j].lod[i]))

  randomDraw = (x) -> x[Math.floor(Math.random()*x.length)]

  randomChr = randomDraw(data.chr)
  randomMarker = randomDraw(data.markers[randomChr])

  # initial phenotype vs genotype plot
  initialPXG = (chr, marker) ->
    botsvg.selectAll("empty")
          .data(data.phevals)
          .enter()
          .append("circle")
          .attr("class", "plotPXG")
          .attr("cx", (d,i) ->
              g = Math.abs(data.geno[marker][i])
              sx = data.sex[i]
              if(chr=="X")
                return xScale[3](sx*2+g-1)+jitter[i]
              xScale[3](sx*3+g-1)+jitter[i])
          .attr("cy", (d) -> yScale[3](d))
          .attr("r", "3")
          .attr("fill", (d,i) ->
              g = data.geno[marker][i]
              return pink if g < 0
              darkGray)
           .attr("stroke", (d,i) ->
               g = data.geno[marker][i]
               return purple if g < 0
               "black")
          .attr("stroke-width", (d,i) ->
               g = data.geno[marker][i]
               return "2" if g < 0
               "1")

  # function to revise phenotype vs genotype plot
  revPXG = (chr, marker) ->
    botsvg.selectAll(".plotPXG")
           .transition().duration(1000)
           .attr("cx", (d,i) ->
               g = Math.abs(data.geno[marker][i])
               sx = data.sex[i]
               if(chr=="X")
                 return xScale[3](sx*2+g-1)+jitter[i]
               xScale[3](sx*3+g-1)+jitter[i])
           .attr("fill", (d,i) ->
               g = data.geno[marker][i]
               return pink if g < 0
               darkGray)
           .attr("stroke", (d,i) ->
               g = data.geno[marker][i]
               return purple if g < 0
               "black")
           .attr("stroke-width", (d,i) ->
               g = data.geno[marker][i]
               return "2" if g < 0
               "1")

  botsvg.append("g").append("path")
       .attr("d", botlodcurve(randomChr)(data.lod[randomChr].pos))
