      .attr("dominant-baseline", "middle")
      .attr("text-anchor", "end")
 
-  svg.append("rect")
-     .attr("x", pad)
-     .attr("y", pad)
-     .attr("height", h-2*pad)
-     .attr("width", w-2*pad)
-     .attr("stroke", "black")
-     .attr("stroke-width", 2)
-     .attr("fill", "none")
 
+  # curves for quantiles
   colors = ["blue", "green", "orange", "red", "black"]
   for j in [3..0]
     colors.push(colors[j])
 
+  curves = svg.append("g")
+
   for j in [0...nQuant]
-    svg.append("path")
+    curves.append("path")
        .datum(data.ind)
        .attr("d", quline(j))
        .attr("class", "line")
        .attr("stroke", colors[j])
 
-  indRect = svg.selectAll("rect.ind")
+  # vertical rectangles representing each array
+  indRectGrp = svg.append("g")
+
+  indRect = indRectGrp.selectAll("rect.ind")
                  .data(data.ind)
                  .enter()
                  .append("rect")

         .on("mouseout", -> d3.select(this).attr("opacity", "0"))


  for j in [0...nQuant]
    svg.selectAll("text.qu")
       .data(data.qu)
       .enter()
       .append("text")

          .attr("width", w)
          .attr("height", h)

  # gray background
  svg.append("rect")
     .attr("x", pad)
     .attr("y", pad)
     .attr("height", h-2*pad)
     .attr("width", w-2*pad)
     .attr("stroke", "none")
     .attr("fill", d3.rgb(200, 200, 200))

  # axis on left
  axis = svg.append("g")

  # axis: white lines
  axis.append("g").selectAll("line.axis")
     .data([-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1])
     .enter()
     .append("line")
