VisIt-tutorial-data-representations

From DOE SciDAC VACET Center Wiki

Jump to: navigation, search
Back to the tutorial index

VisIt supports some analysis and visualization methods that are alternate representations for data. This tutorial walks through three of them:

  • Scatter Plots
  • Parallel coordinates
  • Equivalence Class Functions

Contents

Scatterplots

What are Scatter Plots?

Simple scatter plot of hardyglobal vs. shepardglobal.
Simple scatter plot of hardyglobal vs. shepardglobal.
Scatter Plots are plots of data that show the correlation between variables by mapping them directly to the axes of a 2D or 3D plot. For example, it might be useful to generate a scatterplot of temperature versus pressure. The image to the right is a simple Scatter Plot of two variables from the noise.silo dataset.

Scatter Plots in VisIt can extend into 3D to show the corellation between three independent variables. And finally, VisIt can use color to encode yet a fourth variable in the image. Color can also be added to a 2D Scatter Plot to add a third dimension.

Experiment with Scatter Plots

Your first Scatter Plot

Scatter Plot wizard
Scatter Plot wizard
  1. Open the noise.silo dataset.
  2. From the Plots menu, select "Scatter" and then "hardyglobal".

A Scatter Plot "wizard" appears, allowing easy creation of the plot. Follow the prompts.

  1. From the Variable menu on the right of the wizard, select Scalars->shepardglobal and "Next".
  2. Select the "No" radio button for the Z coordinate and hit "Next".
  3. Select the "No" radio button for color and hit "Next".
  4. Press the "Finish" button.

You now have a Scatter Plot in the Active plots list ready to be drawn.

  1. Hit Draw

You should get the simple picture at the top right of the page (though likely in reverse colors – I like black backgrounds.)

Play with the Plot options

There are a lot of options available for the Scatter Plot. Let's try some of them.

  1. Double-click the plot in the Active plots list to bring up the attributes window.

There are two primary tabs to manipulate the plot, Inputs and Appearance. Let's try changing the inputs to create a more complex Scatter Plot. First note that a summary of all of your input settings are summarized near the bottom of the window for quick reference.

  1. Click "Input 3".
  2. Change the Variable from "default" to "grad_magnitude"
  3. Change the Role from "None" to "Z coordinate".
  4. Click Apply and watch the plot change. Rotate it around to get a sense of the multivariate correllation.

Okay plot, but a bit hard to see. Scatter Plots are best interacted with when "Navigate bbox" mode is turned off. Hit the Image:Bbox_on.png button up in the toolbar to make it look like Image:Bbox_off.png. Interaction will be much nicer now.

3d colored scatter plot
3d colored scatter plot
# Click "Input 4".
  1. Change the Variable from from "default" to "chromeVf".
  2. Change the Role from "None" to "Color".
  3. Click Apply and watch the plot.

Interesting plot. Let's try changing the appearance.

  1. Click the "Appearance" tab at the top.
  2. Change the "Point Type" to "Sphere".
  3. Change the "Point size (pixels)" to 10.
  4. Change the "Color table" to "difference"
  5. Click Apply.

Now the 3D relationship between the points should be more clear.

Parallel coordinates

Parallel coordinates plots have traditionally been used in the field of Information Visualization (or "Info Vis") to display data with a high number of dimensions. We have incorporated parallel coordinates plots into VisIt in a way that allows for the summary of very large data yet still allowing the exploration of individual data points. See Parallel Coordinates Introduction for a pictoral introduction to parallel coordinates in VisIt.

Experiment with Parallel Coordinates

Simple plot

Parallel Coordinates Wizard
Parallel Coordinates Wizard
  1. Open noise.silo
  2. Create a Parallel Coordinates plot and select "hardyglobal".
  3. In the wizard that appears, select "shepardglobal" as the 2nd variable.
  4. If you feel like it, continue to add variables. The set of valid point variables in the noise.silo dataset are: hardyglobal, shepardglobal, airVf, airVfGradient_magnitude, chromeVf, grad_magnitude, radial, and x.
  5. Hit Draw.

You should have a decent looking parallel coordinates plot drawn.

Data restriction

With the plot from the prior exercise, let's try restricting the data to focus on features of interest.

  1. Hit the Axis Restriction tool button Image:Axis_Restriction_Tool.png at the top of the visualization window.

Red arrows will appear at the bottom and top of each of your axes Image:Red_arrows.png. If you drag any of these into your data, the appearance will change. The context (density) is still shown in the background, but individual data lines are drawn over the top.

  1. Continue playing with the axis restriction tool to better understand the trends that you're seeing.

Using Parallel Coordinates to do data subsetting

The Axis Restriction tool can be linked to data subsets in other windows. Let's use your existing Parallel Coordinates plot to restrict a Pseudocolor Plot in a second window.

  1. Open second window
  2. Create Pseudocolor Plot of hardyglobal.
  3. Apply a Threshold Operator
  4. To the Threshold Operator, add the variables that you have in the Parallel Coordinates plot in the first window. (You only need to add the variables that you are going to restrict.)
Lock Tools menu
Lock Tools menu

You might want to lay the windows out so that they don't overlap each other so that changes in one window can be seen quickly in the other window.

  1. In both windows, enable the Lock Tools button Image:Lock_Tools_Button.png. You can also enable it through the Windows->Lock->Tools option, as shown to the right.

Now, when you manipulate the data selection in your Parallel Coordinates plot, the Threshold operator in the other windows changes to reflect your selection.

Equivalence Class Functions (ECFs)

There's a good online introduction to Equivalence Class Functions (Derived Data Functions) at the VisIt Users wiki: DDFs in VisIt

is note: We implemented the functionality of statistical binning in VisIt and called them Derived Data Functions, or DDFs. Only later did we learn that this concept is traditionally known as Equivalence Class Functions, or ECFs, in statistics. We have yet to rename the functionality in VisIt, so you will find us alternately using both terms.

Overview

Equivalence Class Functions allow to do binning of your data across as many axes as you like. You can use spatial coordinates, mesh variables, and time as your axes. Once you've defined your bins, you can declare a statistical operation to take on any data values that land in each bin. The available operators are: Average, Minimum, Maximum, StandardDeviation, Variance, Sum, and Count.

2D Histogram Example

Let's use ECFs to create a 2D histogram of data we explored in the Scatter Plot tutorial.

  1. Open up a Python window from inside VisIt.
  2. Make sure that "noise.silo" is opened.
  3. Put a PseudoColor plot of "hardyglobal" up. (It's not too important what the plot is, just that there's a pipeline active in VisIt.)
  4. Enter and execute the following code:
c = ConstructDDFAttributes()
c.ddfName = "hist"
c.varnames = ("hardyglobal", "shepardglobal")
c.ranges = (2, 5, 2, 5)
c.numSamples = (128, 128)
c.codomainName = "hardyglobal" # Not used when doing "Count" operator
c.statisticalOperator = c.Count
ConstructDDF(c)

A file called "hist.vtk" will be created in your current working directory.

  1. Open hist.vtk in VisIt.
  2. Do a PseudoColor plot of "hardyglobal".

You are directly viewing the ECF. Since we used the Count operator, this is a 2D histogram of hardyglobal vs. shepardglobal. You'll note that it looks rather similar to the Scatter Plot of hardyglobal vs. shepardglobal that you made in an earlier exercise. Only this now has quantitative information about the density of the correlation.

Deviation from Average

Now we're going to create an ECF that is a localized average. We're then going to apply this ECF back to the original dataset, using an expression, to calculate how values differ from the local average.

Back to the tutorial index