Using ILSubfigure
ILSubfigure controls are little more complex than ILPanel.
They include and manage a colorbar, a title bar and a plot panel (ILPanel).
After referencing the assembly ('ILNumerics.Drawing.dll'), the control is available from the
Tools - toolbar. It may be dragged onto a form of your GUI application.
The control is included into the ILNumerics.Drawing.Controls
namespace.
Since ILSubfigures derive from UserControl, they
derive all properties and members a common user control brings. The following
properties are specific to ILSubfigure and may be used for
configuring the subfigure:
| Name | type | purpose |
|---|---|---|
| Panel | ILPanel |
The actual plotting panel. This is the device dependent
plotting control surface. Users will not directly created those
controls. However, you may access all properties for it. ILPanel is described in the previous section. |
| ColorBar | floating child control | The colorbar is used for colored 3D plots. It shows the current
mapping from color scale to value scale. The control can be hidden at runtime and fully configured by code. It is positioned using the common Control properties (Dock, SetBounds etc.) |
| Title | floating child control | The title control is used to label the subfigure. The control can be hidden at runtime and fully configured by code. It is positioned using the common Control properties (Dock, SetBounds etc.) |
Example ILSubfigure creation:
In addition to dragging ILSubfigure controls from the toolbar onto custom forms,
one may create them programmatically. The following code assumes,
you have a .NET 2.0 Windows.Forms form named 'Form1'. It creates the same plot as shown on top of this page. The code needs to be placed into the Form_Load event handler.
using ILNumerics.Drawing;
using ILNumerics.Drawing.Controls;
using ILNumerics.Algorithms;
private void Form1_Load(object sender, EventArgs e) {
// create, add and place the subfigure in existing form
ILSubfigure subfigure = new ILSubfigure();
Controls.Add(subfigure);
subfigure.SetBounds(10,10,500,400);
// add some sample data
subfigure.Panel.Graphs.AddSurfGraph(
ILSpecialData.sinc(28, 36,0.41f)[":;3:5"]);
// dock the colorbar on right side
subfigure.ColorBar.Dock = DockStyle.Right;
subfigure.Panel.Axes[1].Label.Text = "Y Label";
}