1.3 Data Selection

In this lesson we will learn about flexible ways of selecting data for plotting.

Plotting Data from Multiple Worksheets

  1. Let's start with the project we saved in lesson two: Graph Templates and Batch Plotting. Select any workbook, and make sure no data columns are selected. You can click in the gray area outside of columns to remove selection.
  2. Select menu Plot > Basic 2D: Line. The Plot Setup dialog will open.
  3. Click the Double Up Arrow Button.jpg button on the right side to expand the upper panel if it is not already open.
  4. Set the Available Data: drop-down list in the left panel to Worksheets in Folder.

    To pick up worksheets from anywhere in your project, set the drop down to Worksheets in Project.

  5. Hold down shift key and select all three data sheets named Trial Run 1, Trial Run 2 and Trial Run 3.
  6. Using the check boxes in the middle panel, assign Time as X and Position as Y. Click OK button to create the graph.

    This dialog has a third bottom panel which can be used to assign data to different layers in a multi-layer graph. If that panel is open, you can simply collapse it and then click OK to create the graph.

    GST Data Selection 001.png

  7. We will now customize the legend for this graph. Right click on the legend and select Legend: Update Legend...
  8. In the dialog that opens, set Auto Legend Transition Mode as Custom. Clear the Legend Custom Format (@D, @LU etc) edit box and then click the GST Right Arrow Button.png button on the right of this edit box, and in the fly-out menu select @WS: Sheet Display Name.
  9. In the edit box, type a hyphen - after the string @WS, and again click the right arrow button. This time select @LD"Sample": Sample, which corresponds to column header row Sample in the worksheet. Click the OK button. The legend will now display the sheet name and the sample name.
  10. GST Data Selection 041.png

Using another Column to Set Color of a Plot

  1. Go to Project Explorer. In the upper panel, right-click on the root level and choose New Folder.
  2. Right-click on newly created folder, select Rename, and assign the name Data Selection. Click on the empty folder and open it.
  3. Select Help: Open Folder: Sample Folder... to open the "Samples" folder. In this folder, open the Graphing subfolder and find the file US Mean Temperature.dat. Drag-and-drop this file into Origin workspace to import it into a new worksheet.
  4. We want to plot the positions of US major cities (columns Longitude and Latitude) as a scatter plot and then colormap the data points with the annual mean temperature (column Annual). Click on the header of column named January and drag and expand the selection all the way to the column named December. Then right click to choose Hide/Unhide Columns: Hide.
  5. Select the Longitude columns, in the pop-up mini toolbar, select Set As: X button Button Set as X.png.
  6. Select the Latitude and click Scatter button Button Scatter Plot.png on the bottom left toolbar to create the plot of longitude vs. latitude.
  7. Click on the plot, in the pop-up mini toolbar, click the Symbol Edge Color button to expand the color chooser, switch to the By Points tab. In this tab, click the Color Mapping drop-down and select Col(P): "Annual" in the list. The symbol color will be mapped to the column Annual.
  8. GST Data Selection 05.png

  9. Let us now set the axes lengths to scale with the range of X and Y values represented in the graph. Click on the white space of the layer to select the layer, in the pop-up mini toolbar, click Isometric button Button Isometric.png.

    You also can double-click on the white space of the layer to open the Plot Details dialog with the Layer1 node been selected on the left panel. Then go to the Size tab on the right side. Check the Link Axis Length to Scale with X:Y Ratio box and keep the ratio as 1.

  10. Now, let us select another color palette to apply it to the symbol color as colormap. Click on any data point in the graph, and then click on the Palette toolbar button Palette Button.png in the Style toolbar. Select the Temperature palette to better reflect the data. Click anywhere on the graph to deselect the plot.

    You can add a map to a graph using the Maps Online App. This blog post is a good place to start.

    GST Data Selection 06.png

  11. From the menu, choose File: Save Project and save your modified project.

Selecting Multiple Non-adjacent Columns for Plotting

  1. Open a new workbook window by clicking on the New Workbook button Button New Workbook.png in the Standard toolbar.
  2. Select menu Data: Connect to File: Excel. In the file dialog that opens, browse to <Origin EXE Path>\Samples\Import and Export folder and select the file United States Energy (1980-2013).xls. Press Open.
  3. In the Excel Import Options dialog that opens, make sure Auto checkbox to the right of Main header lines is checked and Long Names is set to 1 and Units to 2.
    GST Data Selection 07.png
  4. Press OK to import the file. Then go to the first sheet named Oil. Hold the Ctrl key to select Crude Oil Production, Oil Consumption and Total Oil Production columns.
    GST Data Selection 08.png
  5. Then go to menu Plot > Multi-Panel/Axis: Stack... and accept default settings in the dialog, to create a stacked plot.
  6. Click Save Project button Button Save Project.png on the Standard toolbar to save your project file.