9.3.3 Using a Dataset to Control Plot Attributes

Color is not the only plot attribute that can be controlled by values in a dataset (see, Using a Dataset to Control Plot Color). Several other plot attributes can also be modified using values in an Origin workbook or Excel workbook. When this option is available for a plot attribute, a list of worksheet datasets will display as Col(Name) entries at the bottom of the drop-down list or combination box, where Name is the Origin or Excel workbook column name. Select a column of values to control display of the associated attribute.

Using a Dataset to Control Plot Attributes-1.png


Note: You can copy and paste this attribute mapping to other graphs. Mapped column(s) can be identified by column Short Name, Long Name, Units, Comments,Units, Comments (built-in), Parameter(n) or User-defined Parameter. For more details, see the Match Modifiers by page.


Customizing Increment Lists

Some of the plot attributes listed below support use of a custom list of styles to modify data point display. Style variations are assigned to data points by:

  • Incrementing by one through a list of styles.
  • Indexing values in a dataset to a list of styles.

In either case, you have the option of customizing, saving and reusing an increment list. Use and management of increment lists for these plot attributes is simpler than it is for color lists and for grouped plots.

When you elect to vary data point styles by incrementing or indexing, a tab is added to Plot Details that contains a list of possible styles. Once that list is enabled, you can edit, save or load previously saved lists and use them to control display of certain plot attributes.

Simple increment list.png
  • Rearrange the list by dragging numbers in first column.
  • Flip the list.
  • Select the drop-down list and change the style associated with an individual list member.
  • Right-click to Add members or Delete the selected member.
  • Save or load a previously-saved list.

Controllable Plot Attributes

Line Style

To specify a column to control line style:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Line tab.
  3. Click the Style drop-down and choose a worksheet column by which to increment line style.

This procedure adds a Line Style List tab to Plot Details. Note that the default line style list will be followed unless you go to this tab, and check the Use Custom Increment List box; then customize the list as described above (see Customizing Increment Lists, above, for more information).

Symbol Shape

To specify a column to control symbol shape:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Symbol tab.
  3. Select the Custom Construction check box.
  4. Select the plot control dataset in the Shape drop-down list.


You have two shape lists to choose from -- one that is static and one that is customizable:

  • Default Shape List (static): 0 = no symbol, 1 = square, 2 = circle, 3 = up triangle, 4 = down triangle, 5 = diamond, 6 = cross (+), 7 = cross (x), 8 = star (*), 9 = bar (-), 10 = bar (|), 11 = number, 12 = LETTER, 13 = letter, 14 = right arrow, 15 = left triangle, 16 = right triangle, 17 = hexagon, 18 = five-point star, 19 = pentagon, 20 = sphere. For any numeric values outside of this range (except 56 and 58), no symbol displays. The numeric values of 56 and 58 display special symbol types: 56 = data markers and 58 = vertical lines that mark the X position of the data point.
  • Shape List tab (customizable): Selecting Custom Construction and specifying a shape control dataset adds a Shape List tab to Plot Details. To use a customizable shape list, click on this tab and select Use custom increment list. From there, you can customize, and optionally save, the list as outlined here.

To customize symbol shape for grouped plots, see Plot Details Group tab Controls.

Symbol Interior

To specify a column to control symbol interior:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Symbol tab.
  3. Select the Custom Construction check box.
  4. Select the plot control dataset in the Interior drop-down list.


You have two interior lists to choose from -- one that is static and one that is customizable:

  • Default Interior List (static): 0 = no symbol, 1 = solid, 2 = open, 3 = dot center, 4 = hollow, 5 = + center, 6 = x center, 7 = - center, 8 = | center, 9 = half up, 10 = half right, 11 = half down, 12 = half left. For any numeric values outside of this range, no symbol displays.
  • Interior List tab (customizable): Selecting Custom Construction and specifying an interior control dataset adds a Interior List tab to Plot Details. To use a customizable interior list, click on this tab and select Use custom increment list. From there, you can customize, and optionally save, the list as outlined here.

To customize symbol interior for grouped plots, see Plot Details Group tab Controls.

Symbol Size

To specify a column to control symbol size:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Symbol tab.
  3. Select the Custom Construction check box.
  4. Select the plot control dataset from the Size drop-down list.

When you select a column from the Size combination box, the dataset values are treated as point sizes (units = "points"). You can scale those dataset values by selecting or typing a value in the associated Scaling Factor combination box. For more information, see (Symbol) Size.

Pattern

To specify a column to control fill pattern (e.g. column/bar charts):

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Pattern tab.
  3. Expand Pattern Chooser, go to By Points tab, specify a worksheet column as pattern control values from the Use Column Values drop-down list.
  4. Pattern List tab will appear to let you customize a pattern list. click on the Pattern List tab and select Use custom increment list. From there, you can customize, and optionally save, the list as outlined here.

To customize fill pattern for grouped plots, see Plot Details Group tab Controls.

3D Bar Shape

To specify a column to control 3D bar shape:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Pattern tab.
  3. In the Pattern drop-down list, point to Use column values and expand the next-level drop-down list to specify the worksheet column of bar shape control values.

You have two 3D bar shape lists to choose from -- one that is static and one that is customizable:

  • Default Shape List (static): The default list looks like this, with 0 = Prism/Box, 1 = Cylinder, etc.:
3D Bar Shape list default.png
  • Shape List tab (customizable): Selecting a starting shape in the Increment slider or a dataset from Use column values drop-down list adds a Shape List tab to the Plot Details dialog box. To use a customizable shape list, click on the Shape List tab and select Use custom increment list. From there, you can customize, and optionally save, the list as outlined here.

To customize symbol shape for grouped plots, see Plot Details Group tab Controls.


Label

If you didn't set a column as Label before plotting, you can specify a column as labels for data points as below:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Go to the Label tab, check Enable check box.
  3. Select a column under the Label Form drop-down list.

When you select a column for Label Form drop-down list, the values of this selected column will be added to the graph as labels for data points. The data points and labels are associated by the worksheet row index. You can only choose a column within current worksheet as labels with this Label Form drop-down list; if you want to use column in other worksheet, you need set Label Form as Custom and do further specifications with the sequential shown item Format String text box.

For more information, see the controls in the Plot Details -- Label tab for

Bar/Column Width

To specify a dataset to control column/bar width:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Spacing tab.
  3. Select a dataset in the Width (in %) drop-down list.

When you select a column under the Width (in %) drop-down list, the values determine the relative column/bar(the data point in the same row) width, But the final performance will also be influenced by the Gap Between and Overlap settings, and the Scaling Factor will do contributions too.

For more information, see The Plot Details Spacing tab Controls

Angle for XYAM vector data

To specify a column to control angle:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Vector tab.
  3. Select the plot control dataset in the Angle drop-down list (Vector Data group).

When you select a column from the Angle drop-down list, the dataset values determine the vector angle for each data point in the associated row. The Angle Units combination box is used to change the units.

For more information, see The Plot Details Vector tab Controls.

Magnitude for XYAM vector data

To specify a column to control magnitude:

  1. Open the Plot Details dialog box (Format: Plot).
  2. Choose the Vector tab.
  3. Select the plot control dataset in the Magnitude combination box (Vector Data group).

When you select a column from the Magnitude drop-down list, the dataset values determine the vector magnitude in units of points.

For more information, see The Plot Details Vector tab Controls.

Note: The X End and Y End lists on the Vector tab of the XYXY vector graph's Plot Details dialog box also list columns for control selection. However, the XYXY vector plot elements are only controllable by worksheet dataset selection.

An example: Setting symbol shape with a dataset

In this example, a line + symbol data plot is created. Subsequently, a dataset is designated to control symbol shape, with symbols alternating between squares and circles.

  1. Enter the following data into a worksheet, then highlight column B(Y) and click the Line + Symbol Button Line And Symbol.png button on the 2D Graphs toolbar.
    Using a Dataset to Control Plot Attributes-4.png
  2. Double-click on the data plot to open the Plot Details dialog box.
  3. On the Symbol tab, select the Custom Construction check box.
  4. Scroll to the bottom of the Shape drop-down list. Select Col(C) and click Apply

Note that the Line + Symbol plot now displays with two symbol shapes -- filled square and filled circle. What you have done is to use the C(Y) column values -- 1 and 2 -- to determine symbol shape.

How do these 1 and 2 values relate to symbol shape? If you clear the Custom Construction check box (Symbol tab of Plot Details), then click the down-arrow next to the (symbol) Preview, you will see that the first symbol shape in the symbol gallery is a filled square; the next down is a filled circle; the third down is a filled up-triangle, the fourth is a filled down-triangle, and so forth.

Using a Dataset to Control Plot Attributes-5.png

To Display Both Symbol Shapes in the Legend:

In the example, we used values in dataset to determine symbol shape for a single 2D line & symbol plot. The result was a plot where symbol type varied by data point. Without some adjustments, the plot symbol in the legend will not accurately represent the data plot.

To "fix" the legend, an empty D(Y) column will be added to the graph layer as a line + symbol data plot with circle symbols. Because the column contains no data, the data plot doesn't actually plot in the graph layer. However, we can use the dataset's plot attributes to customize the legend display.

  1. Make the worksheet active and click the Add New Columns Button Add New Columns.png button on the Standard toolbar. Origin adds a D(Y) column to the worksheet.
  2. Make the graph active, right-click on the layer 1 icon in the upper-left corner of the graph and select Plot Setup. This opens the Plot Setup dialog box.
  3. Use the top panel to highlight the book and sheet containing your empty D(Y) column.
  4. Choose Plot Type = Line + Symbol and set column A as X and D as Y (middle right panel of Plot Setup).
  5. Click Add to "add" the empty plot to your graph window and click OK.
  6. With your graph window active, select Format: Plot. This opens the Plot Details dialog box.
  7. Expand the plot tree in the left-hand panel of Plot Details and highlight the [Book]Sheet!A(X), D(Y) plot that you just added to the graph window.
  8. On the Symbol tab, click the down arrow next to the Preview view box.
  9. Select the filled circle (column 1, row 2).
  10. Click OK to close the dialog box.
  11. Right-click on the graph legend and choose Properties from the shortcut menu.
  12. In the Object Properties dialog box, replace the text with \L(1)\L(2) %(1).
  13. Click OK. The legend now displays both filled square and filled circle data plot icons on the same line.

To learn more about the default legend and how to customize it, see Graph Legends in the User Guide and Manual Control of the Graph Legend in the Origin Help file.