/*
  * Delete a function.
  */
 public void deletePlot(Function f) {
   f.cancel();
   plotter.removePlot(f);
   int index = funcList.indexOf(f);
   innerFuncTab.remove(index);
   funcList.remove(index);
   map.remove(f);
 }
 /*
  * Update a function.
  */
 private void updatePlot(
     Function oldFunc, String newExpr[], Color3f newColor, String[] bounds, float[] stepSize)
     throws IllegalExpressionException {
   // Try evaluating the function.
   Function newFunc = createNewFunction(newExpr, newColor, bounds, stepSize);
   newFunc.setView(oldFunc.getView());
   funcList.set(funcList.indexOf(oldFunc), newFunc);
   updateReferences(newFunc);
   FunctionLabel label = map.get(oldFunc);
   label.setMother(newFunc);
   map.remove(oldFunc);
   map.put(newFunc, label);
   setSelected(newFunc);
   plotter.removePlot(oldFunc);
   spawnNewPlotterThread(newFunc);
 }