Пример #1
0
        /// <summary>
        /// Multiple plot windows:
        /// Converts <see cref="Plot2Ddata"/> into an alive Gnuplot object.
        /// </summary>
        public static Gnuplot ToGnuplot(this Plot2Ddata[,] _2DData, GnuplotPageLayout layout = null)
        {
            if (layout != null)
            {
                throw new NotImplementedException("todo");
            }
            if (_2DData.GetLowerBound(0) != 0)
            {
                throw new ArgumentException();
            }
            if (_2DData.GetLowerBound(1) != 0)
            {
                throw new ArgumentException();
            }
            if (_2DData.GetLength(0) <= 0)
            {
                throw new ArgumentException();
            }
            if (_2DData.GetLength(1) <= 0)
            {
                throw new ArgumentException();
            }

            Gnuplot gp = new Gnuplot();

            gp.SetMultiplot(_2DData.GetLength(0), _2DData.GetLength(1));

            for (int iRow = 0; iRow < _2DData.GetLength(0); iRow++)
            {
                for (int iCol = 0; iCol < _2DData.GetLength(1); iCol++)
                {
                    if (_2DData[iRow, iCol] != null)
                    {
                        gp.SetSubPlot(iRow, iCol);
                        _2DData[iRow, iCol].ToGnuplot(gp);
                    }
                }
            }
            return(gp);
        }