title: How to create scatter plot one after another removing previous in d3js?
body: <p>So I have a .csv file having multiple columns of data.
  x,y,d1,d2,d3<br>
  28,77,1,2,3<br>
  27,78,4,5,6<br>
  21,79,2,7,9<br>
  10,80,5,7,8  </p>
  
  <p>I am able to create a scatter plot of d1, d2 &amp; d3 on a single graph but what is required is: first d1 is plotted then it is removed and d2 is plotted &amp; so on.</p>
  
  <p>I know this can be achieved using separate function &amp; setTimeout() for each data set but I have many data sets like this, so writing same code multiple times is not efficient.</p>
  
  <p>Can somebody help me out in this?</p>
  
  <p>EDIT:<br>
  So this is a part of code modified according to what @Lars suggested and it is working as I wanted!</p>
  
  <pre><code>   var indices= d3.keys(mydata1[0])
              .filter(function(d) { return (d !== "xaxis" &amp;&amp; d!="yaxis"); }).sort();
     indices.forEach(function(d, i) {
     setTimeout(function() { update(d); }, 5000 * i);
      });
     function update(idx) {
  
      p.selectAll("ellipse").remove(); //remove previous plot--to give animation like effect
  
      p.selectAll(".R")
      .attr("class", "ellipse")
      .data(mydata1)
      .enter()
      .append("ellipse")
      .attr("cx", function(d){ return scaleX(d["xaxis"]);})
      .attr("cy", function(d){return scaleY(d["yaxis"]);})
      .attr({
          "rx": 3,
          "ry": 4,
          })
      .attr("fill", function(d)
      {    
          d[idx]=(d[idx]/2)+32;
          for(i=0; i&lt;64; i++)
          {
              if (d[idx]==0)
                  return mycolor[0];
              else if(d[idx]&gt;i &amp;&amp; d[idx]&lt;=(i+1))
                  return mycolor[i];
              else if(d[idx]&lt;0)
                  return "none";
          }
      });
  }
  </code></pre>