Package flanagan.plot

Examples of flanagan.plot.PlotGraph


            for(int i=0; i<this.numberOfDataPoints; i++){
                data[3][i] = this.rayleighLine[0] + this.rayleighLine[1]*rayleighOrderMedians[i];
            }

            // Create instance of PlotGraph
            PlotGraph pg = new PlotGraph(data);
            int[] points = {4, 0};
            pg.setPoint(points);
            int[] lines = {0, 3};
            pg.setLine(lines);
            pg.setXaxisLegend("Rayleigh Order Statistic Medians");
            pg.setYaxisLegend("Ordered Data Values");
            pg.setGraphTitle("Rayleigh probability plot:   gradient = " + Fmath.truncate(this.rayleighLine[1], 4) + ", intercept = "  +  Fmath.truncate(this.rayleighLine[0], 4) + ",  R = " + Fmath.truncate(this.rayleighCorrCoeff, 4));
            pg.setGraphTitle2("  beta = " + Fmath.truncate(this.rayleighParam[0], 4));

            // Plot
            pg.plot();

            this.rayleighDone = true;
            this.probPlotDone = true;
        }
View Full Code Here


            for(int i=0; i<this.numberOfDataPoints; i++){
                data[3][i] = this.paretoLine[0] + this.paretoLine[1]*paretoOrderMedians[i];
            }

            // Create instance of PlotGraph
            PlotGraph pg = new PlotGraph(data);
            int[] points = {4, 0};
            pg.setPoint(points);
            int[] lines = {0, 3};
            pg.setLine(lines);
            pg.setXaxisLegend("Pareto Order Statistic Medians");
            pg.setYaxisLegend("Ordered Data Values");
            pg.setGraphTitle("Pareto probability plot:   gradient = " + Fmath.truncate(this.paretoLine[1], 4) + ", intercept = "  +  Fmath.truncate(this.paretoLine[0], 4) + ",  R = " + Fmath.truncate(this.paretoCorrCoeff, 4));
            pg.setGraphTitle2("  alpha = " + Fmath.truncate(this.paretoParam[0], 4) + ", beta = "  +  Fmath.truncate(this.paretoParam[1], 4));

            // Plot
            pg.plot();

            this.paretoDone = true;
            this.probPlotDone = true;
        }
View Full Code Here

            for(int i=0; i<this.numberOfDataPoints; i++){
                data[3][i] = this.fDistributionLine[0] + this.fDistributionLine[1]*fDistributionOrderMedians[i];
            }

            // Create instance of PlotGraph
            PlotGraph pg = new PlotGraph(data);
            int[] points = {4, 0};
            pg.setPoint(points);
            int[] lines = {0, 3};
            pg.setLine(lines);
            pg.setXaxisLegend("F-distribution Order Statistic Medians");
            pg.setYaxisLegend("Ordered Data Values");
            pg.setGraphTitle("F-distribution probability plot:   gradient = " + Fmath.truncate(this.fDistributionLine[1], 4) + ", intercept = "  +  Fmath.truncate(this.fDistributionLine[0], 4) + ",  R = " + Fmath.truncate(this.fDistributionCorrCoeff, 4));
            pg.setGraphTitle2("  nu1 = " + nu1 + ", nu2 = " + nu2);

            // Plot
            pg.plot();

            this.fDistributionDone = true;
            this.probPlotDone = true;
        }
View Full Code Here

            data[2][0]=Fmath.minimum(this.yData);
            data[3][0]=coef[0]+coef[1]*data[2][0];
            data[2][1]=Fmath.maximum(this.yData);
            data[3][1]=coef[0]+coef[1]*data[2][1];

            PlotGraph pg = new PlotGraph(data);
            if(plotWindowCloseChoice){
                pg.setCloseChoice(2);
            }
            else{
                pg.setCloseChoice(1);
            }

            pg.setGraphTitle(title0);
            pg.setGraphTitle2(title1);
            pg.setXaxisLegend("Experimental y value");
            pg.setYaxisLegend("Calculated y value");
            int[] popt = {1, 0};
            pg.setPoint(popt);
            int[] lopt = {0, 3};
            pg.setLine(lopt);

            pg.plot();
        }
    }
View Full Code Here

                  flag=-1;
                  return flag;
          }
      }

        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;
  }
View Full Code Here

                    // 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(best, 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(best, 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;
  }
View Full Code Here

                    // 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;
  }
View Full Code Here

    // plot the standard curve
    private int plott(){
            int returnFlag = 1;

            double[][] plotData = new double[4][];
            PlotGraph pg = null;
            switch(this.plotOptions){
                case 0: plotData[0] = this.analyteConcns;
                        plotData[1] = this.responses;
                        plotData[2] = this.interpolationConcns;
                        plotData[3] = this.calculatedResponses;
                        pg = new PlotGraph(plotData);
                        pg.setXaxisLegend("Analyte concentration (a)");
                        pg.setYaxisLegend("Assay response (r) ");
                        break;
                case 1: int nLen1 = this.nAnalyteConcns;
                        int nLen2 = this.nInterp;
                        if(nLen1!=this.nPlot){
                            nLen1=this.nPlot;
                            nLen2=this.nInterp-1;
                        }
                        plotData[0] = new double[nLen1];
                        plotData[1] = new double[nLen1];
                        plotData[2] = new double[nLen2];
                        plotData[3] = new double[nLen2];
                        if(nLen1!=this.nAnalyteConcns){
                            for(int i=1; i<this.nAnalyteConcns; i++){
                                plotData[0][i-1] = this.log10AnalyteConcns[i];
                                plotData[1][i-1] = this.responses[i];
                            }
                            for(int i=1; i<this.nInterp; i++){
                                plotData[2][i-1] = Math.log10(this.interpolationConcns[i]);
                                plotData[3][i-1] = this.calculatedResponses[i];
                            }
                        }
                        else{
                            plotData[0] = this.log10AnalyteConcns;
                            plotData[1] = this.responses;
                            plotData[3] = this.calculatedResponses;
                            plotData[2] = new double[this.nInterp];
                            for(int i=0; i<this.nInterp; i++){
                                plotData[2][i] = Math.log10(this.interpolationConcns[i]);
                            }
                        }
                        pg = new PlotGraph(plotData);
                        pg.setXaxisLegend("Log10[ Analyte concentration (a) ]");
                        pg.setYaxisLegend("Assay response (r) ");
                        break;

                case 2: nLen1 = this.nAnalyteConcns;
                        nLen2 = this.nInterp;
                        if(nLen1!=this.nPlot){
                            nLen1=this.nPlot;
                            nLen2=this.nInterp-1;
                        }
                        plotData[0] = new double[nLen1];
                        plotData[1] = new double[nLen1];
                        plotData[2] = new double[nLen2];
                        plotData[3] = new double[nLen2];
                        if(nLen1!=this.nAnalyteConcns){
                            for(int i=1; i<this.nAnalyteConcns; i++){
                                plotData[0][i-1] = this.logeAnalyteConcns[i];
                                plotData[1][i-1] = this.responses[i];
                            }
                            for(int i=1; i<this.nInterp; i++){
                                plotData[2][i-1] = Math.log(this.interpolationConcns[i]);
                                plotData[3][i-1] = this.calculatedResponses[i];
                            }
                        }
                        else{
                            plotData[0] = this.logeAnalyteConcns;
                            plotData[1] = this.responses;
                            plotData[3] = this.calculatedResponses;
                            plotData[2] = new double[this.nInterp];
                            for(int i=0; i<this.nInterp; i++){
                                plotData[2][i] = Math.log(this.interpolationConcns[i]);
                            }
                        }
                        pg = new PlotGraph(plotData);
                        pg.setXaxisLegend("Loge[ Analyte concentration (a) ]");
                        pg.setYaxisLegend("Assay response (r) ");
                        break;

                case 3: if(!this.responsesPlot){
                            System.out.println("A log(concentration) v. log(responses) plot is not possible; zero or negative responses");
                            return -1;
                        }
                        nLen1 = this.nAnalyteConcns;
                        nLen2 = this.nInterp;
                        if(nLen1!=this.nPlot){
                            nLen1=this.nPlot;
                            nLen2=this.nInterp-1;
                        }
                        plotData[0] = new double[nLen1];
                        plotData[1] = new double[nLen1];
                        plotData[2] = new double[nLen2];
                        plotData[3] = new double[nLen2];
                        if(nLen1!=this.nAnalyteConcns){
                            for(int i=1; i<this.nAnalyteConcns; i++){
                                plotData[0][i-1] = this.log10AnalyteConcns[i];
                                plotData[1][i-1] = this.log10Responses[i];
                            }
                            for(int i=1; i<this.nInterp; i++){
                                plotData[2][i-1] = Math.log10(this.interpolationConcns[i]);
                                plotData[3][i-1] = Math.log10(this.calculatedResponses[i]);
                            }
                        }
                        else{
                            plotData[0] = this.log10AnalyteConcns;
                            plotData[1] = this.log10Responses;
                            plotData[2] = new double[this.nInterp];
                            plotData[3] = new double[this.nInterp];
                            for(int i=0; i<this.nInterp; i++){
                                plotData[2][i] = Math.log10(this.interpolationConcns[i]);
                                plotData[3][i] = Math.log10(this.calculatedResponses[i]);
                            }
                        }
                        pg = new PlotGraph(plotData);
                        pg.setXaxisLegend("Log10[ Analyte concentration (a) ]");
                        pg.setYaxisLegend("Log10[ Assay response (r) ]");
                        break;

                case 4: if(!this.responsesPlot){
                            System.out.println("A log(concentration) v. log(responses) plot is not possible; zero or negative responses");
                            return -1;
                        }
                        nLen1 = this.nAnalyteConcns;
                        nLen2 = this.nInterp;
                        if(nLen1!=this.nPlot){
                            nLen1=this.nPlot;
                            nLen2=this.nInterp-1;
                        }
                        plotData[0] = new double[nLen1];
                        plotData[1] = new double[nLen1];
                        plotData[2] = new double[nLen2];
                        plotData[3] = new double[nLen2];
                        if(nLen1!=this.nAnalyteConcns){
                            for(int i=1; i<this.nAnalyteConcns; i++){
                                plotData[0][i-1] = this.logeAnalyteConcns[i];
                                plotData[1][i-1] = this.logeResponses[i];
                            }
                            for(int i=1; i<this.nInterp; i++){
                                plotData[2][i-1] = Math.log(this.interpolationConcns[i]);
                                plotData[3][i-1] = Math.log(this.calculatedResponses[i]);
                            }
                        }
                        else{
                            plotData[0] = this.logeAnalyteConcns;
                            plotData[1] = this.logeResponses;
                            plotData[2] = new double[this.nInterp];
                            plotData[3] = new double[this.nInterp];
                            for(int i=0; i<this.nInterp; i++){
                                plotData[2][i] = Math.log(this.interpolationConcns[i]);
                                plotData[3][i] = Math.log(this.calculatedResponses[i]);
                            }
                        }
                        pg = new PlotGraph(plotData);
                        pg.setXaxisLegend("Loge[ Analyte concentration (a) ]");
                        pg.setYaxisLegend("Loge[ Assay response (r) ]");
                        break;
            }

            int[] points = {1, 0};
            pg.setPoint(points);
            int[] lines = {0, 3};
            pg.setLine(lines);

            pg.setGraphTitle(this.titleZero);
            pg.setGraphTitle2(this.titleOne);
            pg.plot();

            return returnFlag;
    }
View Full Code Here

                cdata[0][k]=cdata[0][k-1];
                cdata[1][k]=0.0D;
                k++;
            }

            PlotGraph pg = new PlotGraph(cdata);
            pg.setGraphTitle("Histogram:  Bin Width = "+binWidth);
            pg.setLine(3);
            pg.setPoint(0);
            pg.setYaxisLegend("Frequency");
            if(xLegend!=null)pg.setXaxisLegend(xLegend);
            pg.plot();

            return results;
        }
View Full Code Here

            cdata[1][i] = kpterm + sum;
            cdata[0][i] += super.deadTime;
        }

        // Plot
        PlotGraph pg = new PlotGraph(cdata);

        pg.setGraphTitle("Step Input Transient:   Step magnitude = "+stepMag);
        pg.setGraphTitle2(this.getName());
        pg.setXaxisLegend("Time");
        pg.setXaxisUnitsName("s");
        pg.setYaxisLegend("Output");
        pg.setPoint(0);
        pg.plot();
    }
View Full Code Here

TOP

Related Classes of flanagan.plot.PlotGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.