Array Visualizer Configuration options
For visualizing memory from arrays or pointers one needs to specify at least the following two information:
- What is visualized? Use the Array Expression text box at the very top of the Array Visualizer tool window to describe the data you are interested in.
- How is the result presented? Select one of the enabled plot types from the Plot Selector and configure the result. This is explained below.
Further options are available: one may apply further configurations to the selected plot type. Or export the resulting display / resulting data.
Plot types are enabled / disabled automatically according to the shape and element type of the expression evaluation result. "T" marks a textual display of the data ans is always enabled. All available plot types are presented here: plotting types.
Below the Plot Selector you can find a row of additional configuration options. This area adopts to the selected plot type dynamically.
The default presentation output type is Text. In this mode the array produced by your expression evaluation is printed (using the ILNumerics.Array<T>.ToString() function with extended formatting). This view is useful for inspecting individual element values and for keeping the shape of the result in sight.
- Columns / Rows: toogles between column major and row major modes. In 'Columns' mode multidimensional arrays are displayed by slices (matrices) along the first two dimensions. This view on arrays is well known from other system, namely Matlab(R) and FORTRAN arrays, where elements are stored along the columns. 'Rows', on the other hand, displays multidimensional array data as slices starting with the last two dimensions. This corresponds to the way arrays are stored by the .NET CLR and C/C++ by default. This scheme is often preferred in numpy. Note, that only arrays with more than 2 dimensions are affected by this setting.
- Limits: too large arrays are abreviated to only display a limited number of elements. The limit applies to the overall number of elements of the array and to the number of elements displayed along each dimension. The 'Llimits' link shows the currently selected limits. Click on the link to bring up a small dialog box allowing to adjust both limits individually.
ILNumerics Array Visualizer provides many output types: Text output and graphical displays, utilizing the plot cube from ILNumerics Visualization Engine. Each output type is individually configurable. Some configuration options are found in every plot cube based visualization. Their settings are individually maintained and stored for each output type:
- 2D / 3D Display - toogles the interactive mode. 2D mode allows a selection rectangle to be drawn & used for zoom-in operations. This works best for axis aligned line plots. In 3D mode the left mouse button rotates the plot cube. Other mouse interactions are always available: panning by right mouse, zoom by mouse wheel and reset of the plot cube view by double clicking the scene.
- Auto Limits - when activated - causes a rescaling of the current limits of the plot cube axes when changes to the source data occur. This corresponds to the same action triggered by a double click on the plot which resets the scene view. If Auto Limits is off the plot cube will not adjust its axes limits, unless the user performs manual zoom / reset operations.
- The maximize button enlarges the Array Visualizer plot cube area and optimizes space for small tool windows. There are 4 states, which are iterated each time the user clicks on the button:
- (default) the plot cube is stretched to use more space of the tool window but keeps all labels visible. This mode does not maintain the aspect ratio of the plot content. Hence, 3D plots may look distorted.
- The plot cube is even more enlarged which may bring some axes labels outside of the visible area.
- Plot cube and axes labels are completely visible. Aspect ratio of the content is maintained.
- The plot cube is enlarged while focussing on maintaining the aspect ratio of its content. Some labels may be hidden.
- Log [X|Y|Z] - logarithmic scales for the corresponding axis of the current plot. Note, that the logarithm of negative values is not defined and causes the corresponding data point to vanish (NaN).
In addition to that, each output type provides its individual set of configuration options: colormapping plots as surface and imagesc plots allow the definition of the colormap. Colorbar and legends can be activated or hidden, wireframe lines can be enabled or disabled. For line and scatter plots the line and point color is configurable as well as the size. Furthermore, line plots allow the selection of markers. Antialiasing is another available option for line plots.
The following options are accessed from the top menu of the Array Visualizer tool window.
- Array Descriptor Mode The "Show Array Descriptors" menu is used to toogle the usage mode and enables / hides the array descriptor.
- Auto Refresh Descriptor By default all unlocked parts of an array descriptor are automatically updated with the next expression evaluation. Set this flag to Off and the array descriptor will not be updated automatically. In order to reset the array descriptor, one can still hold CTRL and press Enter.
Further reading: learn how to export data from the Share menu.
The Array Visualizer is configurable from the ILNumerics section of the Visual Studio Options dialog:
Visual Studio -> Tools -> Options
Configuration options include:
- Default Renderer - specify which rendering driver is used for plotting: OpenGL (default) is the recommended setting. OpenGL is available on modern machines and offers hardware accelerated rendering. Whenever you experience slow rendering during interaction on large data, make sure to use OpenGL rendering here. The ILNumerics internal software renderer is based on GDI and is provided as a fallback option. It potentially causes lower framerates.
- Max. Number of Lines - the maximum number of lines displayed for the Multiple Lines Plot output type. Default: 50
- Renderer Timeout - maximum time span a GDI driver is allowed to spend on rendering a single frame. After this time span is over, the rendering is cancelled and a label "Timeout" will indicate the partial result. This prevents the debug engine in Visual Studio from timing out and affects GDI renderers only. For OpenGL renderers this setting is ignored.
- Upper Limit of Data Dimensions - if the expression provided by the user leads to a data block too large for rendering the data dimensions are sampled down automatically. This setting specifies the maximum number of elements in each dimension up from which down-sampling kicks in.