HG-1000: Plot XY Data

In this tutorial, you will learn how to plot XY data.

In this tutorial, you will:
  • Plot curves from files.
  • Plot multiples curves in one window.
  • Plot multiple curves in multiple windows.
  • Use the Advanced Plot Options dialog to change the curve and plot attributes.

The Build Plots panel allows you to construct multiple curves and plots from a single data file. Curves can be overlaid in a single window or each curve can be assigned to a new window.

The Advanced Options feature on the Build Plots panel allows you to apply many options at once to the session during plotting. Curves created in this manner are added to the session in a new layer.

The Multiple File Plotting dialog allows you to select multiple files with intersecting data (for example, multiple runs of a particular test) and plot the data from all files simultaneously in the current HyperGraph session.

Open the demo.dat File

  1. From File menu, select New > Session to clear all contents in the HyperGraph session.
  2. Verify XY Plot is selected from the plot type menu, .
  3. Click the Build Plots icon, .
  4. Click the Open File button, , and select the demo.dat file, located in the plotting folder.

Build Multiple Curves on a Single Plot

  1. For X type: select Time.
  2. From the Y type: column, select Force.
    The data available in the file is listed under the Y Request column.
  3. Under Y Request:, click the expansion button, , to easily view the Y Request list.
  4. Under Y Request:, press and hold the Ctrl key and select REQ/3 Curve 3, REQ/5 Curve 5, REQ/7 Curve 7, and REQ/9 Curve9.
  5. Click OK to close the expanded list dialog.
  6. Under Y Component:, select X.
  7. Click Apply to create the curves on page 1.
    The plot’s X axis is labeled Time (the X type), while the y axis is labeled Force (the Y type). The plot’s title is X (the Y Component name). The curve’s names are the Y Request names.


    Figure 2.

Build Multiple Curves on Multiple Plots

While in the Build Plots panel, do the following:

  1. Verify X type: Time is selected.
  2. Under Y type:, leave Force selected.
  3. Under Y Request:, leave REQ/3, REQ/5, REQ/7, and REQ/9 selected.
  4. Under Y Component:, press the Ctrl key and select Y and Z to add them to the already selected X.
    OR
    1. Press the Shift key and select Z. This selects Z and everything between X and Z.
      OR
    2. Left click on X and drag the mouse down to Z.
  5. From the Layout: drop-down menu, select One plot per Request.
    This option creates one plot for each selected Y request. Each plot contains as many curves as there are selected Y components. The plot’s title is the Y Request name. The curve’s label is the Y Component name.
  6. Click the Page Layout button, , and select the four-window layout from the panel area.
  7. Click Apply to create the plots and curves on page 2.
    Figure 3.

Use Advanced Options to Change the Curve and Plot Display Attributes

While in the Build Plots panel, do the following:

  1. Keep the curves you created in Step 3.
  2. Click Adv. Options.
    The Advanced Plot Options dialog is displayed.
  3. To change the page title font, click Page Options on the left side of the dialog.
  4. Click in the Font field on the right side of the dialog. Next, click the Font icon, , to display the Font dialog. Change the font size to 16.
  5. Under Plot Options, select Header.
  6. Click in the Header field on the right side of the dialog to activate the drop-down menu. Deselect Y-Component.
    This will remove the Y component from the header.
  7. Select Horizontal Axis from the left side of the dialog. Click in the Font field on the right side of the dialog. Next, click the Font icon, , to display the Font dialog.
  8. From the Font dialog, change the font size to 12.
  9. Repeat steps 7 and 8 the Vertical Axis.
  10. Select Legend from the left side of the dialog.
  11. From the Font dialog, change the legend font size to 10.
  12. Select Curve Options from the left side of the dialog.
  13. Click in the Label field on the right side of the dialog to activate the drop-down menu. Deselect Y Request.
    This removes the Y request from the label.
  14. Activate Show Prefix.
  15. Click the Label Prefix field. Once the cursor is displayed, enter Test 17.
  16. Click OK to exit the Advanced Options dialog.
  17. From the Build Plots panel, click Apply.

You can also perform filtering on the curve. For this, retain the curve and plot modifications you just performed.

  1. From the Build Plots panel, select Adv. Options.
  2. Click Curve Options on the left side of the dialog.
  3. Activate Math Expression.
  4. Leave Expression for x as is.
  5. Enter the following filter in the Expression for y field: saefilt95(u,v,60,5,3).
  6. Click OK.
  7. From the Build Plots panel, click Apply.
  8. From Define Curves panel, , you will see the filter you applied display in the y vector field:

Use Multiple File Plotting to Plot Multiples Curves in One Plot

  1. From File menu, select New > Session to clear all contents in the HyperGraph session.
  2. Verify XY Plot is selected from the plot type menu, .
  3. Click the Build Plots icon, .
  4. Next to Data File, click the Multiple File Selection icon, .
    The Multiple File Plotting dialog is displayed.
  5. Next to Select directory, click the Open File button, , and select the MultipleFiles folder, located in the plotting folder.
    Figure 4.
  6. You can expand the folders in the File Browser List to display the files contained in each folder.
    Figure 5.

    You can select files from the File Browser List and click the arrow, , to move them to the Selected File Set. For this tutorial, we will filter them.

  7. In the File-Filter field, enter *T01 and press Enter. The following files are displayed:
    Figure 6.
  8. While holding the Ctrl button, select the first eight files listed under File Browser List and click the right-facing arrow, , to move them to the Selected File Set.
  9. Under Curve Name, leave Prefix activated and select Directory Level 2 from the drop-down menu.
    Figure 7.
  10. Under Curve Attributes (Color/Style), leave By File selected.
  11. Click Select to exit the dialog.
  12. From the Build Plots panel, make the following selections:
    1. For Y Type:, select Global Variables.
    2. For Y Request:, select Internal Energy and Kinetic Energy.
    3. For Y Component:, select MAG.
  13. From the Layout: drop-down menu, select One plot per Request.
  14. Click the Page Layout button, , and select the two-window layout from the panel area.
  15. Click Apply.
    Figure 8.
  16. You can also view the curve Label Prefix and Label information in the Plot Browser. These fields were edited using the Advanced Options dialog in Step 4.
    Figure 9.