Multiplexed data

Data is always represented as a vector in Waterloo plots (i.e. as a 1 x N array). As multiple plots can be added to graphs, and to each other, there is no need to create multiplexed plots but the facility to do so is built-in to most plot types nonetheless.
  • To determine if a plot type supports multiplexing, call the isMultiplexible method on an instance (most do).
  • To determine if a plot contains muliplexed data, call the isMultiplexed method.
  • To determine how many data sets there are, call the getMultiplexLength method.
The getMultiplexLength method returns an integer which is equal to the largest of the sizes of the ArrayLists representing the lineColor, lineStyle, markerArray, edgeColor, edgeStyle and fill in the visual model for the plot.

isMultiplexed returns true if this number is greater than one AND isMultiplexible returns true.

For plots that return true for isMultiplexed, the paintPlot method will draw the data sets as separate plots in a graph.

The GJCyclicArrayList

The properties listed above are stored in the visual model as GJCyclicArrayLists.
As with standard array lists, elements are accessed with the get(index) method but for cyclic array lists this is overridden to call:
                super.get(index % size());
Cyclic array lists therefore cycle through their elements as index is increased. Note that the size here is the size of the specific instance: cycling is independent for each of the lineColor, lineStyle, markerArray, edgeColor, edgeStyle and fill properties. For a scatter plot with two elements in the markerArray and four fill colors specified the paintPlot method will display:
  1. Marker 0 with Fill 0 - for (x0, y0)
  2. Marker 1 with Fill 1 - for (x1, y1)
  3. Marker 0 with Fill 2 - for (x2, y2)
  4. Marker 1 with Fill 3 - for (x3, y3)
then repeat the cycle for (x4,y4) through (x7,y7), (x8, y8) through (x11, y11) etc.

For a line plot where getMuliplexLength returns 4, the data will be displayed as 4 separate lines - colored as:

                super.get(n % size());
where n is the number of the line in the sequence (0..3).