d = new FunctionDialog(); d.setFunction("cos(x)^2"); d.setPoints(200); d.setRange(-10,10); d.setLabel(); d.Apply(); l = new LegendDialog(); l.enableBorder(false); l.Apply();