dataFile0="../example_stat_report0.txt"; dataFile1="../example_stat_report1.txt"; graphSize=[720,860]; function strOfVals=readStrOfFlts(dataFile) res=[]; n=1; while(mgetstr(1,dataFile)<>ascii(10)) res(n)=mfscanf(1,dataFile,"%f"); n=n+1; end strOfVals=res; endfunction function dataN=readFileFunc(fileName) dat.fileName=fileName; dataFile=mopen(fileName,'rb'); for i=1:1:9 execstr([strcat(["dat.",mfscanf(1,dataFile,"%s"),.. "=mfscanf(1,dataFile,""%f"");"])]); end for i=1:1:9 execstr([strcat(["dat.",mfscanf(1,dataFile,"%s"),.. "=readStrOfFlts(dataFile);"])]); end mclose(dataFile); dataN=dat; endfunction function mnL=mainLeg(dat) mnL=[strcat(["Dim:",string(dat.Dimensionality),.. "; Known spheres:",string(dat.Number_of_known_spheres),.. "; Mult:",string(dat.Multiplier),.. "; Runs:",string(dat.Number_of_runs),";"]),.. strcat(["Uncertainties:[",.. string(dat.Start_uncertainty),", ",.. string(dat.End_uncertainty),"], increment:",.. string(dat.Uncertainty_incr),"; "]),.. strcat(["Samples:",.. string(dat.Samples_for_one_uncertainty_value),.. " x Uncertainties; ",.. "Statistical discretisation:",.. string(dat.Statistical_discretisation)," "])]; endfunction function gw=DrawPlotFor(windowsIdx,postfix,title) gw=scf(graphWindows(windowsIdx)); clf(); xlfont(strcat(["../../documentation/fonts/cm-unicode-0.7.0/",.. "CMU_Typewriter_Text-Medium.otf"]),0); xtitle(title,"Sensor uncertainty","Expected value"); cidx=(length(gw.color_map)/3)+1; gw.color_map(cidx,1:3)=0.5; ax0=gca(); ax0.grid=[cidx,cidx]; ax0.grid_style=[9,9]; ax0.grid_thickness=[1,1]; ax0.filled="off"; ax0.font_style=0;ax0.font_size=3; ax0.title.font_style=0; ax0.title.font_size=4; ax0.x_label.font_style=0; ax0.x_label.font_size=3; ax0.y_label.font_style=0; ax0.y_label.font_size=3; execstr([strcat(["yVals=data0.Expected_",postfix])]); cEE0=plot(data0.Sensor_uncertainty,yVals,'Color','#0000aa'); cEE0.thickness=2; cEE0.line_mode="on"; cS=plot([0],[0]); cS.line_mode="off";cS=plot([0],[0]); cS.line_mode="off"; execstr([strcat(["yVals=data0.Expected_",postfix,"+",.. "data0.Sigma_",postfix])]); cSE0=plot(data0.Sensor_uncertainty,yVals,'Color','#5555c7'); cSE0.thickness=2; cSE0.line_mode="on"; cSE0.line_style=3; execstr([strcat(["yVals=data0.Min_",postfix])]); cMinE0=plot(data0.Sensor_uncertainty,yVals,'Color','#5555c7'); cMinE0.thickness=2; cMinE0.line_mode="on"; cMinE0.line_style=7; execstr([strcat(["yVals=data1.Expected_",postfix])]); cEE1=plot(data1.Sensor_uncertainty,yVals,'Color','#aa0000'); cEE1.thickness=2; cEE1.line_mode="on"; cS=plot([0],[0]); cS.line_mode="off";cS=plot([0],[0]); cS.line_mode="off"; execstr([strcat(["yVals=data1.Expected_",postfix,"+",.. "data1.Sigma_",postfix])]); cSE1=plot(data1.Sensor_uncertainty,yVals,'Color','#c75555'); cSE1.thickness=2; cSE1.line_mode="on"; cSE1.line_style=3; execstr([strcat(["yVals=data1.Min_",postfix])]); cMinE1=plot(data1.Sensor_uncertainty,yVals,'Color','#c75555'); cMinE1.thickness=2; cMinE1.line_mode="on"; cMinE1.line_style=7; execstr([strcat(["yVals=data0.Max_",postfix])]); cMaxE0=plot(data0.Sensor_uncertainty,yVals,'Color','#5555c7'); cMaxE0.thickness=2;cMaxE0.line_mode="on"; cMaxE0.line_style=7; execstr([strcat(["yVals=data1.Max_",postfix])]); cMaxE1=plot(data1.Sensor_uncertainty,yVals,'Color','#c75555'); cMaxE1.thickness=2; cMaxE1.line_mode="on"; cMaxE1.line_style=7; legend(ax0,mainLeg(data0),"Expected+StdDeviation","min/max",.. mainLeg(data1),"Expected+StdDeviation","min/max",-6); endfunction data0=readFileFunc(dataFile0); data1=readFileFunc(dataFile1); if exists("graphWindows")==0 for i=1:1:2 graphWindows(i)=scf(); end end /* expected error */ DrawPlotFor(1,"err","Expected Error Value"); obj=gcf(); obj.figure_size=graphSize; obj.children.margins(3)=0.05; obj.children.margins(4)=obj.children.margins(4)-2*obj.children.margins(3); obj.anti_aliasing="16x"; xs2png(obj,"errors.png"); xs2svg(obj,"errors.svg");/* add "fill-opacity:0;" to svg-background */ /* expected solves */ DrawPlotFor(2,"solves","Expected Solves"); obj=gcf(); obj.figure_size=graphSize; obj.children.margins(3)=0.05; obj.children.margins(4)=obj.children.margins(4)-2*obj.children.margins(3); obj.anti_aliasing="16x"; xs2png(obj,"solves.png"); xs2svg(obj,"solves.svg");/* add "fill-opacity:0;" to svg-background */