}
String colorAtt = getOption(optionalArgs, "-color");
int tempC = getIndexOfAttribute(toPlot, colorAtt);
AttributeVisualizationPanel offScreenPlot =
new AttributeVisualizationPanel();
offScreenPlot.setSize(width, height);
offScreenPlot.setInstances(toPlot);
offScreenPlot.setAttribute(attIndex);
if (tempC >= 0) {
offScreenPlot.setColoringIndex(tempC);
}
// render
java.awt.Graphics g = osi.getGraphics();
offScreenPlot.paintComponent(g);
// wait a little while so that the calculation thread can complete
Thread.sleep(2000);
offScreenPlot.paintComponent(g);
// offScreenPlot.setAttribute(attIndex);
return osi;
}