Industrial Data Science
in C# and .NET:
Simple. Fast. Reliable.
 
 

ILNumerics - Technical Computing

Modern High Performance Tools for Technical

Computing and Visualization in Industry and Science

Plot Cube Position & Size

TL;DR

While PlotCube by default automatically maintains the size and position of its inner components you may control the exact 2D extent of its inner rendering area by: plotCube.DataScreenRect. It expects the rectangle to be specified in coordinate ranging from 0..1, relative to the ScreenRect of the plot cube.  

Plot Cube ScreenRect

Since multiple plot cubes (and/or Cameras) may be hosted on the same control / the same rendering area, each plot cube is individually positioned and sized by the setting: PlotCube.ScreenRect. This property controls the overall size the plot cube occupies within the rendering area. ScreenRect is given as relative coordinates - according to the screen 2D coordinate system: the upper left corner of the control's ScreenRect corresponds to coordinate (0,0). The lower right corner corresponds to (1,1). 

PlotCube.ScreenRect, therefore, is the natural extension of Control.ScreenRect to a virtual plot cube, being hosted within the control. 

Data Screen Rect 

By default the plot cube automatically determines the size and positions of its inner components: labels, tick marks etc. are ensured to be visible, even during arbitrary rotations in 3D. The remaining area is used for rendering the data plots contained in the plot cube. During rotations and while rendering plot cube automatically finds the best edge of the plot cube to display the axis labels and ticks for each dimension. Hence, the values of the DataScreenRect area is constantly recomputed according to the current visibility, position and size of all axes and all labels. 

Explicitly controlling the Plot Cube Data Size

The default value for DataScreenRect is null. This signals the plot cube to automatically find good looking position / size for rendering the inner data cube. By assigning a value to DataScreenRect you take responsibility for positioning the inner data cube within the plot cube's screen rectangle. 

Example: two plot cubes are created and positioned / sized to use half of the rendering area, each. The DataScreenRect property of the lower plot is used to explicitly control the area used for rendering the inner plot cube data area. 

Note that DataScreenRect does not include the size for labels or tick lines. It is only the extent of the plot cube's main edge lines which is tightly fit into DataScreenRect. All supporting elements, like labels etc. are drawn around the cube afterwards. Note further, that such labels may be clipped and not visible, if DataScreenRect was chosen to be too large. Further, explicit settings of DataScreenRect are most useful for 2D output, since interactive rotations in 3D easily lead labels and/or ticks to clipping, i.e.: to become invisible.

See also: 

Aspect ratios and content fit mode

Multiple plot cubes

Plot cube properties