Document 173

How to import and plot data sets in SW

Version: 2.5 - Scientific WorkPlace & Scientific Word

Users sometimes want to import data sets into SW so they can use Maple or Mathematica to create plots. Here's how to go about it:

  1. Import the data into an SW document:

    1. Place the insertion point where you want the data to appear.

    2. From the File menu, choose Import Contents.

    3. When the dialog box appears, select the file that contains the data you want to plot.

    4. Choose Open.

      Your data will appear at the insertion point in the SW document.

  2. To make sure SW interprets the data as mathematics, select the imported data and then click the Math/Text button or press ctrl+m or ctrl+t. The button appears as Math/Text button .

  3. Make sure that each data item is separated from the next with a comma. Use the search and replace feature (Edit menu) if necessary.

  4. Place the data in a matrix:

    • If your data is set up so that each x value is followed by a y value, create a single matrix:

      1. Select the data.

      2. From the Maple menu, choose Matrices and then choose Reshape.

      3. In the Number of Columns entry area of the Reshape Matrix dialog box, enter 2.

    • If your data is set up so that all the x values come before all the y values, you must create two one-column matrices and then concatenate them:

      1. Select the x values.

      2. From the Maple menu, choose Matrices and then choose Reshape.

      3. In the Number of Columns entry area of the Reshape Matrix dialog box, enter 1.

      4. Select the y values.

      5. From the Maple menu, choose Matricesand then choose Reshape.

      6. In the Number of Columns entry area of the Reshape Matrix dialog box, enter 1.

      7. Select both matrices.

      8. From the Maple menu, choose Matricesand then choose Concatenate.

  5. Place the insertion point to the immediate right of the matrix.

  6. From the Maple menu, choose Plot 2D and then choose Rectangular.

    You can modify the plot to show either a line or points, and you can change both the range and domain to suit your needs.

Added 08/07/96; revised 09/19/03

This document was created with Scientific WorkPlace.