static void PlotAll (Scene& scene, Plotter& plotter) { Vector x(1,steps), Pot(1,steps); for (int i = 1; i <= steps; i++) { x(i) = xmin + (i-1)*(xmax-xmin)/(steps-1); Pot(i) = V(x(i)); } plotter.clear(); double ymin = -1, ymax = min(6.0,max(1.0,Max(Pot))); // betwwen 1 and 6 !! plotter.axisframe(xmin,xmax,ymin,ymax, "x","V(x), Psi(x)"); plotter.style(plotter.LINES); plotter.plot(x,Pot); // potential scene.Line(xmin,ymin,xmin,ymax); scene.Line(xmax,ymin,xmax,ymax); scene.SetColor(ColorB(255,0,0)); // wave function plotter.plot(x,Psi); scene.SetColor(ColorB(0,0,255)); // eigen energy scene.Line(xmin,E,xmax,E); scene.SetTextStyle(Standard); char label[60]; sprintf(label,"E=%.8g",E); scene.Write(xmin+0.01,E+0.05,label); }