/// <summary> /// Single plot window: /// 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"); } Gnuplot gp = new Gnuplot(); _2DData.ToGnuplot(gp); return(gp); }
/// <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); }