// Create a title
title1 = this.setGandPtitle(title);
title2 = " points - experimental values; line - best fit curve; y data array " + jj;
if(weightOpt)title2 = title2 +"; error bars - weighting factors";
PlotGraph pg = new PlotGraph(data);
if(plotWindowCloseChoice){
pg.setCloseChoice(2);
}
else{
pg.setCloseChoice(1);
}
pg.setGraphTitle(title1);
pg.setGraphTitle2(title2);
pg.setXaxisLegend(this.xLegend);
pg.setYaxisLegend(this.yLegend);
int[] popt = {1,0};
pg.setPoint(popt);
int[] lopt = {0,3};
pg.setLine(lopt);
if(weightOpt)pg.setErrorBars(0,wWeight);
pg.plot();
}
}
else{
int ncurves = 2;
int npoints = 200;
if(npoints<this.nData0)npoints=this.nData0;
if(this.lastMethod==6)npoints=this.nData0;
String title1, title2;
double[][] data = PlotGraph.data(ncurves, npoints);
for(int i=0; i<this.nData0; i++){
data[0][i] = this.xData[0][i];
data[1][i] = this.yData[i];
}
if(this.lastMethod==6){
double[] xd = new double[this.nXarrays];
for(int i=0; i<npoints; i++){
data[2][i]=data[0][i];
xd[0] = data[2][i];
data[3][i] = g1.function(this.values, xd);
}
}
else{
double xmin =Fmath.minimum(xData[0]);
double xmax =Fmath.maximum(xData[0]);
double inc = (xmax - xmin)/(double)(npoints - 1);
data[2][0]=xmin;
for(int i=1; i<npoints; i++)data[2][i] = data[2][i-1] + inc;
double[] xd = new double[this.nXarrays];
for(int i=0; i<npoints; i++){
xd[0] = data[2][i];
data[3][i] = g1.function(this.values, xd);
}
}
// Create a title
title1 = this.setGandPtitle(title);
title2 = " points - experimental values; line - best fit curve";
if(weightOpt)title2 = title2 +"; error bars - weighting factors";
PlotGraph pg = new PlotGraph(data);
if(plotWindowCloseChoice){
pg.setCloseChoice(2);
}
else{
pg.setCloseChoice(1);
}
pg.setGraphTitle(title1);
pg.setGraphTitle2(title2);
pg.setXaxisLegend(this.xLegend);
pg.setYaxisLegend(this.yLegend);
int[] popt = {1,0};
pg.setPoint(popt);
int[] lopt = {0,3};
pg.setLine(lopt);
if(weightOpt)pg.setErrorBars(0,this.weight);
pg.plot();
}
}
return flag;
}