Skip to content

Commit 1f78db9

Browse files
committed
nplot from console
1 parent 6f77741 commit 1f78db9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

examples/plotting/nplot/NPlotQuickstart/Form1.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/plotting/nplot/NPlotQuickstart/Form1.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Drawing;
3+
using System.Drawing.Imaging;
34
using System.Windows.Forms;
45

56
namespace NPlotQuickstart
@@ -9,6 +10,21 @@ public partial class Form1 : Form
910
public Form1()
1011
{
1112
InitializeComponent();
13+
ScatterButton_Click(null, null);
14+
}
15+
16+
private void Form1_Load(object sender, EventArgs e)
17+
{
18+
// simulate plotting from a console application
19+
var linePlot = new NPlot.PointPlot { DataSource = RandomWalk(20) };
20+
var surface = new NPlot.Bitmap.PlotSurface2D(400, 300);
21+
surface.BackColor = Color.White;
22+
surface.Add(linePlot);
23+
surface.Title = $"Scatter Plot from a Console Application";
24+
surface.YAxis1.Label = "Vertical Axis Label";
25+
surface.XAxis1.Label = "Horizontal Axis Label";
26+
surface.Refresh();
27+
surface.Bitmap.Save("nplot-console-quickstart.png");
1228
}
1329

1430
private Random rand = new Random(0);

0 commit comments

Comments
 (0)