-- the two web pages: a viewer for one svg file and a player for a series of them Viewer, Player = Graphics.SVGHTMLViewer() file = io.open("Viewer.html", "w") file:write(Viewer) file:close() file = io.open("Player.html", "w") file:write(Player) file:close() -- a film for the player: two levels that split by Delta from 0 to 3 eV, one svg file per Delta. -- The numbers in the names have two digits, so that the files sort in the right order. for k = 0, 12 do local Delta = 0.25*k local G = ResponseFunction.New({ {0, -0.4*Delta, 0.6*Delta}, {0.4, 0.6}, mu = 0, type = "ListOfPoles" }) local pl = Graphics.Plot(G/Pi, 0.2, 0, 501, {{"plotRe",false}, {"Negate",true}, {"Frame",{{"Xmin",-2}, {"Xmax",3}, {"Ymin",-0.1}, {"Ymax",3.4}, {"FirstYTick",0}, {"dYTick",1}, {"XLabel","energy (eV)"}, {"YLabel","density of states"}, {"XLMargin",0.1}, {"YAxis",-10}}}}) pl.Add(string.format("Delta = %.2f eV", Delta), 0.95, 0.9, {{"Size",0.04}, {"Alignment","r"}}) file = io.open(string.format("Film_%02d.svg", k), "w") file:write(Graphics.ToSVG(pl, {{"RelativeSize",true}})) file:close() end