13 double xMin,
double xMax,
14 double yMin,
double yMax,
15 string? gradientText =
null,
16 bool drawGradientVector =
false,
20 InitializeComponent();
23 this.Text =
"2D Skalarfeld Visualisierung";
24 this.Size =
new Size(800, 600);
25 this.BackColor = System.Drawing.Color.FromArgb(33, 33, 33);
28 Panel? leftPanel =
null;
29 if (!
string.IsNullOrWhiteSpace(gradientText))
31 leftPanel =
new Panel();
32 leftPanel.Dock = DockStyle.Fill;
33 leftPanel.Width = 200;
34 leftPanel.BackColor = System.Drawing.Color.FromArgb(33, 33, 33);
36 var gradientLabel =
new System.Windows.Forms.Label();
37 gradientLabel.Text = gradientText;
38 gradientLabel.ForeColor = System.Drawing.Color.White;
39 gradientLabel.BackColor = System.Drawing.Color.FromArgb(33, 33, 33);
40 gradientLabel.AutoSize =
true;
41 gradientLabel.Location =
new Point(10, 20);
42 leftPanel.Controls.Add(gradientLabel);
46 var formsPlot =
new ScottPlot.WinForms.FormsPlot();
47 formsPlot.Dock = DockStyle.Fill;
49 var plt = formsPlot.Plot;
50 var heatmap = plt.Add.Heatmap(data);
51 plt.Title(
"f(x, y) als Heatmap");
52 plt.FigureBackground.Color = Colors.Black;
53 plt.DataBackground.Color =
new ScottPlot.Color(33, 33, 33);
54 plt.Axes.Color(Colors.White);
55 plt.Axes.Left.Label.Text =
"y";
56 plt.Axes.Bottom.Label.Text =
"x";
57 plt.Axes.SetLimits(-25, 25, -25, 25);
58 heatmap.Position =
new(-25, 25, -25, 25);
61 heatmap.Colormap =
new Turbo();
62 var bar = plt.Add.ColorBar(heatmap);
64 var mainLayout =
new TableLayoutPanel();
65 mainLayout.Dock = DockStyle.Fill;
66 mainLayout.ColumnCount = 2;
67 mainLayout.ColumnStyles.Add(
new ColumnStyle(SizeType.Absolute, 200));
68 mainLayout.ColumnStyles.Add(
new ColumnStyle(SizeType.Percent, 100));
71 if (leftPanel !=
null)
72 mainLayout.Controls.Add(leftPanel, 0, 0);
74 mainLayout.ColumnStyles[0].Width = 0;
76 mainLayout.Controls.Add(formsPlot, 1, 0);
77 this.Controls.Add(mainLayout);