Higher Dimension Charts

 

In addition to the standard charts with one-dimensional data, LINGO offers 2-dimensional curve and scatter charts, as well as 3-dimensional bubble, contour and surface charts.  When a chart requires more than one dimension of data, you can supply the data in either of two ways.  The first method is to supply one attribute for each dimension.  So, for example, a 3-dimensional surface chart might be specified using the three attributes XVALS, YVALS and ZVALS.  The first attribute always stores the x-axis data, the second stores the y-axis and, if needed, the third attribute stores the z-axis values.  The second option is to provide a data series in an m x n table/attribute, where m is the number of data points and n is the dimension of the chart type.

As an example, suppose we have the following model that generates points of the surface X * SIN( Y) + Y * SIN( X):

MODEL:

 

SETS:

 POINTS /1..21/;

 POINTS2( POINTS, POINTS): X, Y, Z;

ENDSETS

 

CALC:

 XS = @FLOOR( -(@SIZE( POINTS) / 2) + .5);

 YS = XS;

 @FOR( POINTS2( I, J):

   X( I, J) = XS + I - 1;

   Y( I, J) = YS + J - 1;

   Z( I, J) = X( I, J) * @SIN( Y( I, J)) +

     Y( I, J ) * @SIN( X( I, J));

 );

ENDCALC

 

END

Model: CHARTSURF

A surface chart requires 3-dimensional data, which, in this case, is contained in the X, Y and Z attributes.  To request a surface chart after solving the model, we fill out the Solver|Solution dialog box as follows:

surfacechart

Note that we've listed each of the three attributes in the Attribute(s) or Row Name(s) field.  Given that this is a 3-dimensional graph, the three attributes will be used to create a single chart.  Clicking on OK then gives us the chart:

surfacechart2

Below we list the dimensions of each of the various chart types and whether or not they allow for multiple data series:

Chart Type

Dimension

Supports Multiple Series

Bar

1

Yes

Histogram

1

No

Line

1

Yes

Pie

1

No

Radar

1

Yes

Curve

2

Yes

Netarc

2

Yes

Netnode

2

Yes

Scatter

2

Yes

Tornado

2

No

Bubble

3

Yes

Contour

3

No

Surface

3

No