{
if (RViewer.getGraph(title) == null)
{// create new graph
RViewer.setNewGraphName(title);
eval("JavaGD(\"aa\")","JavaGD() failed");
REXP devNum = eval("dev.cur()","failed to do dev.cur");
RViewer.getGraph(title).init(devNum.asInt()-1);
}
eval("dev.set("+(RViewer.getGraph(title).getDeviceNumber()+1)+")","failed to do dev.set for "+title);
for(String cmd:dataToPlot)
eval(cmd,"failed to run plot "+cmd);
}