/// <summary> /// Create or close gnuplot for given table. /// </summary> /// <param name="table"> /// A <see cref="Table"/> /// </param> public static void ToggleGnuPlot(Table table) { GnuPlot gnuPlot = GetExistingGnuPlot(table); if (gnuPlot == null) { gnuPlot = new GnuPlot(table); gnupDict.Add(table, gnuPlot); } else { gnuPlot.Quit(); } }
/// <summary> /// Plots into SVG file. /// As this merely redraws into export file, the current view from the plot window will be used. /// </summary> /// <param name="table"> /// A <see cref="Table"/> /// </param> public static void CreateSVG(Table table, string svgPath) { GnuPlot gnuPlot = GetExistingGnuPlot(table); if (gnuPlot == null) { throw new GnuPlotException("Need existing gnuplot window."); } // Test creating empty file in order to get possible exception. // Otherwise no easy way to get feedback from gnuplot error. // Sort of Unix command 'touch'. File.WriteAllText(svgPath, string.Empty); CreateSVG(gnuPlot.stdInputStream, svgPath); }
static void Remove(GnuPlot gnuplot) { Table table = null; foreach (var kvp in gnupDict) { if (kvp.Value == gnuplot) { table = kvp.Key; break; } } if (table != null) { gnupDict.Remove(table); } }
static void Remove(GnuPlot gnuplot) { Table table = null; foreach (var kvp in gnupDict) { if (kvp.Value == gnuplot) { table = kvp.Key; break; } } if (table != null) gnupDict.Remove (table); }
/// <summary> /// Create or close gnuplot for given table. /// </summary> /// <param name="table"> /// A <see cref="Table"/> /// </param> public static void ToggleGnuPlot(Table table) { GnuPlot gnuPlot = GetExistingGnuPlot (table); if (gnuPlot == null) { gnuPlot = new GnuPlot (table); gnupDict.Add (table, gnuPlot); } else { gnuPlot.Quit (); } }