## 3.6 Visualizing 2-Dimensional Data

This section describes several ways of visualizing 2-dimensional scalar and vector data.

### Colors

Using the AutoColor tool to color 2-dimensional data is the simplest visualization method available. By default, AutoColor assigns blue to the smallest values and red to the largest. (If the data are vector, the colors are based on the magnitude of the vectors).

1. Open and execute visual program `.../AutoColor2D.net`.

   The resulting image is a map of temperatures around the world: highest near the equator and over continents; lowest near the poles and in the oceans.

2. To display the temperature values associated with each color, connect the output tab of the `ColorBar` icon in the VPE window to the open input tab on the `Collect` icon.
3. Reexecute the visual program.

The `Color` tool and the `Colormap Editor` provide additional control of the color map:

1. Open and execute visual program `.../Color2D.net`.
2. Open the `Colormap Editor` by double clicking on the `Colormap` icon.
3. Select `Execute on Change` in the `Execute` pull-down menu. Any change you now make in the `Colormap Editor` appears immediately in the image. For example, you can experiment with:
   - moving control points (clicking on and dragging)
   - adding control points (double clicking at the desired location)
   - deleting control points (double clicking on individual points).
4. Connect the output tab of the `ColorBar` icon in the VPE window to the open input tab on the `Collect` icon.
5. Select `Execute on Change` in the `Execute` pull-down menu. The color bar from the `Colormap Editor` now also appears in the image. Again, a change made in the editor is immediately reflected in the image.

For more information, see AutoColor, Color, and ColorBar, in IBM Visualization Data Explorer User's Reference.

### Contour Lines

Contour lines connect points of the same value in a 2-dimensional data set. The visual program in this example uses elevation data for the southeastern United States.

1. Open and execute visual program `.../Isosurface2D.net`.

   The contour line that appears in the image has an isosurface value of 0 meters (sea level).

2. Open the `Isosurface` configuration dialog box.
3. In the `value` parameter field, change "0.0" to "20" and click on `OK`. The dialog box closes.
4. Select `Execute on Change` in the `Execute` pull-down menu and note the change in the contour line.
5. Reopen the Isosurface configuration dialog box and type "0 20" in the `value` parameter field.
6. Click on `OK`. The image now consists of two contour lines.

For more information, see Isosurface in IBM Visualization Data Explorer User's Reference.

### Streamlines

If your 2-dimensional data set consists of vectors, you can create streamlines that trace the path of a massless particle in a vector field.

1. Open and execute visual program `.../Streamlines2D.net`. The image is a set of streamlines that follow a wind field over the surface of the earth.
2. Change the number of streamlines by changing the value of the `density` parameter in the configuration dialog box of the `Sample` tool.
3. Reexecute the visual program.

Note: Streamlines can be generated in other ways as well. For example:

1. Pass a list of 2-dimensional positions to the `start` parameter in the `Streamline` configuration dialog box by either:
   1. inserting a `VectorList` interactor stand-in (from `Interactor` in the categories palette) into the visual program, and connecting it to the `start` parameter tab of Streamline or
   2. typing the start positions in the configuration dialog box for `Streamline`.

2. Use the `Grid` tool (from `Realization` in the categories palette) to create a particular set of start positions. Any field that contains positions can be used as the starting point for streamlines.

   This sample visual program contains a Grid tool. Connect it to the `start` parameter tab of Streamline. It generates a 3 × 3 grid of points. Modify it to create a 10 × 3 grid of starting points.

3. Use the `Probe` tool (from `Special` in the categories palette) to select starting points in the Image window.

   This sample visual program contains a Probe tool. (Compute is used to make the value of the probe point 2-dimensional.) Connect the output of Compute to the `start` input tab of Streamline, and then move the probe (i.e., enter cursor mode, using the `View Control` dialog box).

See Grid, Probe, and Streamline in IBM Visualization Data Explorer User's Reference.

### RubberSheet

You can "warp" the representation of 2-dimensional data with the `RubberSheet` tool.

1. Open and execute visual program `.../RubberSheet.net`. The image represents elevation above sea level in the southeastern United States. Regions of greatest elevation are colored red; regions of lowest elevation, blue.
2. Open the `RubberSheet` configuration dialog box.
3. Change the value in the `scale` parameter field to ".002."
4. Click on `OK` and reexecute the visual program. The contrast of variation is greatly increased.

For more information, see RubberSheet in IBM Visualization Data Explorer User's Reference.

You can also add contour lines to a Rubbersheet image:

1. Select `Realization` in the categories palette and then `Isosurface` in the tools palette.
2. Place the icon to the right of `RubberSheet`.
3. Connect the output of `RubberSheet` to the first input tab of `Isosurface` (the only connection that Data Explorer will allow you to make). Make sure that you do not break the connection to `Shade`.
4. Open the `Isosurface` configuration dialog box.
5. Change the `number` parameter value to "10" and click on `OK`.
6. Select `Structuring` in the categories palette and `Collect` in the tools palette.
7. Place the `Collect` icon below `Isosurface`.
8. Connect the outputs of both `Shade` and `Isosurface` to the inputs of `Collect` (again, Data Explorer will allow only valid connections).
9. Disconnect `Image` from `Shade`.
10. Connect the output of `Collect` to the input of `Image`.
11. Reexecute the visual program. The result is a set of colored contour lines combined with the Rubbersheet image.

You can change the color of the contour lines:

1. Select `Transformation` in the categories palette and then `Color` in the tools palette.
2. Place the `Color` icon to the right of `RubberSheet` and `Collect`.
3. Open the `Color` configuration dialog box.
4. Delete "(no color added)" in the `color` parameter field and type in "black" (the quotation marks are unnecessary and will be added by Data Explorer).
5. Click on `OK`.
6. Move the output of `Isosurface` from `Collect` to `Color`.
7. Connect the output of `Color` to the input of `Collect`.
8. Reexecute the visual program.

See Color and Isosurface in IBM Visualization Data Explorer User's Reference.

### 2-D Scalar Glyphs

In this example, elevation data are represented both by color and by glyphs (the black circles).

1. Open and execute visual program `.../AutoGlyph2DScalar.net`. The elevation values range from higher (orange; larger circles) to lower (blue; smaller circles). The size of each glyph (circle) is proportional to the data value it represents. To display these values:
2. Open the configuration dialog box for `AutoGlyph`.
3. In the `type` parameter field, replace "(input dependent)" with "text" and click on `OK`.
4. Reexecute the program. The actual data values that appear are called text glyphs.

See AutoGlyph in IBM Visualization Data Explorer User's Reference.

### 2-D Vector Glyphs

Glyphs can be used to represent vector as well as scalar data.

- Open and execute visual program `.../AutoGlyph2DVector.net`.

  Again, data values are represented by color and by glyphs (arrows). In this example of wind velocity data, colors represent the magnitude and arrows the direction. (The black squares signify missing data or data omitted as invalid by the `Include` module in the program.)

See AutoGlyph in IBM Visualization Data Explorer User's Reference.

[ OpenDX Home at IBM | OpenDX.org ]