public MultipleScatterAndFunctionsRepresentation Copy()
        {
            MultipleScatterAndFunctionsRepresentation newCopy =
                new MultipleScatterAndFunctionsRepresentation(pictureWidth, pictureHeight);

            newCopy.theRepresentingFunctions =
                new List <Func <DenseVector, double, double> >(theRepresentingFunctions);
            newCopy.parameters             = new List <DenseVector>(parameters);
            newCopy.dvScatterXSpace        = new List <DenseVector>(dvScatterXSpace);
            newCopy.dvScatterFuncValues    = new List <DenseVector>(dvScatterFuncValues);
            newCopy.lineColors             = new List <Bgr>(lineColors);
            newCopy.scatterLineColors      = new List <Bgr>(scatterLineColors);
            newCopy.scatterDrawingVariants = new List <SequencesDrawingVariants>(scatterDrawingVariants);
            newCopy.xSpaceMin           = xSpaceMin;
            newCopy.xSpaceMax           = xSpaceMax;
            newCopy.yAxisNote           = yAxisNote;
            newCopy.xAxisNote           = xAxisNote;
            newCopy.overallFuncMax      = overallFuncMax;
            newCopy.overallFuncMin      = overallFuncMin;
            newCopy.verticalMarkersList = new List <double>(verticalMarkersList);
            newCopy.verticalMarkersIndexesUsingXSpace =
                new List <int>(verticalMarkersIndexesUsingXSpace);
            newCopy.equalScale          = equalScale;
            newCopy.fixSpecifiedMargins = fixSpecifiedMargins;
            newCopy.drawZeroLines       = drawZeroLines;

            newCopy.Represent();
            return(newCopy);
        }
Exemple #2
0
 public static string SaveVectorDataAsImagePlot(this IEnumerable <double> enumSource, string fileName, SequencesDrawingVariants variant = SequencesDrawingVariants.circles)
 {
     if (fileName != "")
     {
         try
         {
             MultipleScatterAndFunctionsRepresentation plotter = new MultipleScatterAndFunctionsRepresentation(2560, 1600);
             DenseVector xSpace     = DenseVector.Create(enumSource.Count(), idx => (double)idx);
             DenseVector funcValues = DenseVector.OfEnumerable(enumSource);
             plotter.dvScatterXSpace.Add(xSpace);
             plotter.dvScatterFuncValues.Add(funcValues);
             plotter.scatterDrawingVariants.Add(variant);
             plotter.scatterLineColors.Add(new Bgr(Color.Green));
             plotter.Represent();
             plotter.SaveToImage(fileName);
             return(fileName);
         }
         catch (Exception ex)
         {
             return("");
         }
     }
     return("");
 }