loadplots - loads and formats saved plots
Given a file generated by xsave of by the save menu in graphic window this function returns a data structure containing the context and plot definition.
rec is a typed list with type "SPLOT". Each of its 2:$ fields contains a graphic instruction definition and its parameters. rec(i)(1) gives the fields names of the i th graphic instruction
txt=string(rec) generates the Scilab instructions which reproduce the plot. To make the necessary functions known, load the loadplots function first. This can be done with the instruction
loadplots;
driver('Rec');xbasc();plot2d([0 1.5 4]) //make a plot xsave(TMPDIR+'/foo.scg') //save it in a binary file rec=loadplots(TMPDIR+'/foo.scg'); //get the associated data structure //here rec(9) is the data structure associated with the plot2d instruction rec(9).x //the x vector rec(9).y //the y vector string(rec) //the scilab instructions producing the same plot mputl(string(rec),TMPDIR+'/foo.sce') //creates a script file xbasc();exec(TMPDIR+'/foo.sce',-1) //execute it to re-create the plot