public void Test_Layout_LabelsWithLineBreaks() { string name = System.Reflection.MethodBase.GetCurrentMethod().Name.Replace("Figure_", ""); string fileName = System.IO.Path.GetFullPath($"{outputPath}/{name}.png"); int pointCount = 50; double[] dataXs = ScottPlot.DataGen.Consecutive(pointCount); double[] dataSin = ScottPlot.DataGen.Sin(pointCount); double[] dataCos = ScottPlot.DataGen.Cos(pointCount); var plt = new ScottPlot.Plot(width, height); plt.PlotScatter(dataXs, dataSin); plt.PlotScatter(dataXs, dataCos); string labelWithLineBreak = "Line One\nLine Two"; plt.Title(labelWithLineBreak, fontSize: 30); plt.XLabel(labelWithLineBreak); plt.YLabel(labelWithLineBreak); if (outputPath != null) { plt.SaveFig(fileName); } else { Console.WriteLine(plt.GetHashCode()); } Console.WriteLine($"Saved: {fileName}"); }
public void Test_Layout() { string name = System.Reflection.MethodBase.GetCurrentMethod().Name.Replace("Figure_", ""); string fileName = System.IO.Path.GetFullPath($"{outputPath}/{name}.png"); int pointCount = 50; double[] dataXs = ScottPlot.DataGen.Consecutive(pointCount); double[] dataSin = ScottPlot.DataGen.Sin(pointCount); double[] dataCos = ScottPlot.DataGen.Cos(pointCount); var plt = new ScottPlot.Plot(width, height); plt.PlotScatter(dataXs, dataSin); plt.PlotScatter(dataXs, dataCos); plt.Title("Very Complicated Data"); plt.XLabel("Experiment Duration"); plt.YLabel("Productivity"); if (outputPath != null) { plt.SaveFig(fileName); } else { Console.WriteLine(plt.GetHashCode()); } Console.WriteLine($"Saved: {fileName}"); }
public void TestMethod1() { var plt = new ScottPlot.Plot(); plt.PlotScatter( xs: new double[] { 2, 4, 6 }, ys: new double[] { 4, 16, 36 } ); System.Drawing.Bitmap bmp = plt.GetBitmap(); // force a render Console.WriteLine(plt.GetHashCode()); // force a render too }