title: androidplot - how can I empty SimpleXYSeries
body: <p>i presume it is pretty basic, but I can't find the solution.
  I have something like this:</p>
  
  <pre><code>public SimpleXYSeries historySeries;
  historySeries = new SimpleXYSeries("something");
  </code></pre>
  
  <p>then in background thread I add some data to the series:</p>
  
  <pre><code>historySeries.addLast(newRoll, newAzimuth);
  </code></pre>
  
  <p>Question is, how can I easily just remove all the data entries from the series, when needed?</p>
  
  <p>Right now I have something like:</p>
  
  <pre><code>public void initSeries() {
          historyPlot.removeSeries(historySeries);
          historySeries = null;
          historyPlot.clear();
          historySeries = new SimpleXYSeries("something");
          historyPlot.addSeries(historySeries, lpf);
      }
  </code></pre>
  
  <p>It works, but graph flickers when I do addSeries again.</p>
  
  <p>EDIT:</p>
  
  <p>I have resolved the issue by making my own version of SimpleXYSeries and added a method:</p>
  
  <pre><code>    public void removeXY() {
          lock.writeLock().lock();
          try {
              xVals.clear();
              yVals.clear();
          } finally {
              lock.writeLock().unlock();
          }
      }
  </code></pre>