«Plotting: Graph Layers Plotting: Graph Layers Understanding Layers The layer is the fundamental building block for Origin graphs. Put most simply, a ...»
Chapter 9: Plotting: Graph Layers
Plotting: Graph Layers
The layer is the fundamental building block for Origin graphs. Put most simply, a layer is an object
consisting of one set of axes. A layer’s axes control how the data plot is displayed in the layer. Axes have
scales that determine the range of data displayed, and tick marks and tick labels that give the data plot
meaning. Origin automatically determines how to scale and label the axes depending on the data plot, but Origin also provides control over the organization and look of the graph. This fact, and the fact that a graph window can have multiple layers that may themselves be independent of each other or “linked,” allows Origin to produce very complex graphs with minimum effort.
Note: To learn more about layers, review the LINE & SCATTER PLOTS.OPJ project and the INSET.OPJ project located in your Origin \SAMPLES\GRAPHING\2D PLOTS folder.
Defining the Layer A layer is an Origin object that contains one set of controlling axes that may or may not be displayed. In addition, the layer can contain data plots or labels (objects) that may or may not be displayed.
A layer necessarily resides in a window and a graph window necessarily contains at least one layer.
The page of the Origin graph window can hold up to 50 layers. Each layer can be moved or sized on the page. Additionally, each layer has a layer icon located in the upper-left corner of the graph that visually displays whether the layer is active or not.
Finally, a layer possesses properties and methods that are addressable from LabTalk and which can alter the layer's appearance and function.
Reasons for Adding Another Layer to a Graph
In general, new layers are added to a graph for the following reasons:
1) Display the same data plot, but on different axis scales (for example, Celsius and Fahrenheit, or miles and kilometers).
2) Create and arrange multiple graphs within one graph window.
3) Inset a graph within a graph.
Defining the Active Layer When a layer is active it is receptive to program commands. All operations, for example plotting or adding text labels, are always performed on the active layer. Only one layer can be active at a time.
Understanding Layers • 239 Chapter 9: Plotting: Graph Layers Each layer has an associated layer icon in the upper-left corner of the graph window. The icon appears as a small gray rectangle containing the layer number. Layer icons tell you which layer is the active layer, and allow you to set the active layer. When a layer is active, its layer icon depresses.
If the View:Show:Active Layer Indicator menu command is checked, the active layer will also be indicated by highlighted axes. This menu command is page specific, meaning you must select the menu command for individual graph windows.
Clicking once on a layer icon will cause that layer to become active. Double-clicking on a layer icon will open the Layer n dialog box for the layer. Origin provides the following alternative methods to set the
1) Click on the X or Y axis within the layer.
2) Click anywhere within the frame of the layer. This procedure may be difficult if multiple layers are not separated spatially.
3) Click on the plot type icon in the legend of the respective layer.
To ensure that a layer can be made active only by clicking on the layer icon, select Format:Page. This menu command opens the Plot Details dialog box with the page (graph) icon selected on the left side of the dialog box. Select the Miscellaneous tab and then select the Set Active Layer by Layer Icon Only check box.
Terminology: Parent Layer vs. Child Layer In a multiple layer graph, you can link layers to ensure that if one layer is moved or resized, other selected layers will move or resize to maintain the original spatial layer arrangement. Additionally, you can link layers to ensure that a selected layer's axis scale will always update to reflect the axis scale of the layer that it is linked to.
Origin uses specific terminology (child, parent) when referring to a layer that is linked to another layer.
For example, if layer 4 is linked to layer 2, then layer 4 is termed the child layer and layer 2 is termed the parent layer. The child layer is always linked to the parent layer. Thus, you can customize the child layer's properties so that the child layer will always move or resize if the parent layer moves or resizes.
Additionally, you can customize the child layer's properties so that the child layer's axes scales will always update to reflect any changes to the parent layer's axes scales.
Controlling the Display of Elements Associated with a Layer The layer properties are controlled in the Plot Details dialog box when the desired layer icon is selected on the left side of the dialog box.
To open the Plot Details dialog box with the layer icon in the dialog box active, perform one of the
1) Click on the X or Y axes of the desired layer (or within the frame) to select the layer. Select Format:Layer.
2) Press CTRL while double-clicking on the desired layer icon.
3) Double-click on the desired layer icon to open the Layer n dialog box. Click the Layer Properties button.
4) Right-click on the active layer icon and select Layer Properties from the shortcut menu.
Displaying a Layer Background Color and Adding a Border You can display a layer color and add a border on the Background tab of the layer's Plot Details dialog box.
The (Layer) Background Tab on the Plot Details Dialog Box By default, the layer does not display a background color. Rather, its display is transparent. Therefore, any color that is applied to the graph page also displays in each of the layers that it contains.
To add a background color to a layer, open the layer's Plot Details dialog box. Select the Background tab, and then select the desired color from the Color drop-down list (None = transparent).
Controlling the Display of Elements Associated with a Layer • 242
Chapter 9: Plotting: Graph LayersThe layer border is a bounding box outside of the layer frame. To display the layer border, select a border from the Border Style drop-down list. Note that the border can be moved and resized independently of the layer. To do this, click on the border line to select it. A highlighted boundary with control handles displays. Move or resize the border in the same way as other objects.
Displaying the Layer Frame Unless you offset the axes or disable their display, the layer frame is exactly coincident with the X and Y axes in a 2D graph layer. In a 3D graph, the layer frame displays just outside of the axes. To temporarily view the layer frame, click on the X, Y, or Z axis. The highlighted boundary box comprises the frame. To display the layer frame, select View:Show:Frame. This menu command is checked when active.
Note: To hide any data that extends beyond the frame, select the Clip Data to Frame check box on the Display tab of the layer's Plot Details dialog box.
Changing the Size of a Layer The layer frame is the bounding box that defines the size and shape of the layer. To change the layer dimensions, either manually resize the frame, or specify the desired frame dimensions on the Size/Speed tab of the layer's Plot Details dialog box. Additionally, you can resize a layer so that it returns to the default (maximum) size on the page by selecting the layer, and then selecting View:Maximize Layer.
This menu command provides a fast method for maximizing the dimensions of a layer whose size has been reduced.
When you resize a layer, by default the axis labels, tick labels, legend, and data will scale with the layer (as well as any other objects that are attached to the Layer Frame or Layer and Scales in their respective Label Control dialog box, Format:Label Control). The scaling of these elements is controlled on the Display tab of the layer's Plot Details dialog box.
Controlling the Display of Elements Associated with a Layer • 243
Chapter 9: Plotting: Graph LayersChanging the Layer Dimensions by Manually Sizing the Frame Activate the layer frame for sizing by clicking on one of the axes in the layer. Once the frame is active, a sizing box with control handles displays.
1) To size the layer frame, drag a control handle. When dragging the control handle, an outline of the layer changes size. The actual layer frame remains at its current size until you release the mouse button and click outside the layer (but within the graph window).
2) To proportionally size the layer frame, press CTRL and then click on a control handle. Release the CTRL key (while still holding down the mouse button) and drag the layer to the desired size. Click outside the layer (but within the graph window) to fix the new size.
Specifying New Layer Dimensions in the Plot Details Dialog Box The layer dimensions are set on the Size/Speed tab of the layer's Plot Details dialog box.
Note: When you set the size of the layer, you are also setting the size of the axes in the layer. To set the layer (and thus the axes) to a specific width and height, select the desired units (for example, inch, cm, or mm) from the Units drop-down list in the Layer Area group. Then enter the desired dimensions in the Width and Height text boxes.
The (Layer) Size/Speed Tab on the Plot Details Dialog Box
To Specify the Layer Area:
To numerically position or resize the layer, type values in the Left, Top, Width, and Height text boxes.
The Left text box value determines the position of the frame relative to the left side of the page. The Top
text box value determines the position of the frame relative to the top of the page. The Height and Width text box values determine the size of the frame. Select the desired units from the Units drop-down list.
1) The % of Page unit is useful for maintaining the same layer size relative to the page size. When this unit is selected, the Left, Top, Height, and Width text box values are in percentage of the graph page height and width.
2) The % of Linked Layer unit is useful for creating inset graphs. This unit allows you to specify the frame dimensions and offsets for a child layer in terms of the dimensions of the parent layer frame. When this unit is selected, the Left, Top, Height, and Width text box values are in percentage of the height and width of the parent layer frame. (This unit is not available unless the current layer is linked to a parent layer.) Note: When the unit selection is changed in the drop-down list, the Left, Top, Height, and Width text box values are automatically updated so that the layer retains the same size and position.
To Increase the Redraw Speed of the Layer:
Select a buffering method from the Graphic Image Caching drop-down list. Graphic image caching can be used whenever a 2D or 3D graph layer needs to be redrawn without being refreshed. For example, when a graph window is overlaid by a worksheet window and then brought to the front again, or when the graph window is resized. For 2D graph layers, select Raster to use caching. For 3D graph layers, select Raster or Vector.
1) Vector (metafile) buffering provides Origin with a detailed description of how to draw the graph and is fully scaleable.
2) Raster (bitmap) buffering tells Origin how many pixels of what color to draw at what position. This information is based on a certain resolution and will become distorted when resized.
Note: If you resize your graph in raster caching mode, the graph may get a rough pixel appearance. If this occurs, select Window:Refresh to restore the display.
If you select None, Origin redraws the graph layer every time the graph window is moved, brought to the front, or resized.
In addition to graphic image caching, you can use Origin's speed mode to increase the redraw speed of your graph layer. With speed mode, you can control the number of data points displayed in a graph layer.
This option is most useful when working with large data sets.
Select the Worksheet Data, Maximum Points Per Curve check box to enable speed mode for all the data plots in the layer that are created from worksheet data. Type the desired value (n) in the associated text box. If the number of data points in a data plot exceeds n, Origin displays a subset of the data plot that contains n points. This subset contains evenly spaced data - by the worksheet rows.
For 3D data plots created from a matrix or for contour data in the layer, select the Matrix Data, Maximum Points Per Dimension check box to enable speed mode. Type the desired value (n, m) in the X and Y text boxes. If the number of data points in a data plot exceeds n or m, Origin displays a subset of the data plot that contains n and m points. This subset contains evenly spaced data - by the matrix columns (X) and matrix rows (Y).
Controlling the Display of Elements Associated with a Layer • 245
Chapter 9: Plotting: Graph LayersControlling the Display and Scaling of the Objects in a Layer Origin provides controls to turn on and off the display of the axes, axes labels, legend, and data in the layer
- as well as any other objects that are attached to the Layer Frame or Layer and Scales in their respective Label Control dialog box (Format:Label Control). These controls are provided on the Display tab of the layer's Plot Details dialog box. Additionally, you can control the scale of these objects with respect to the layer on this tab.
The (Layer) Display Tab on the Plot Details Dialog Box
The Scale Elements Group This group determines how the axes, axes labels, legend, data plots, and other objects that are attached to the Layer Frame or Layer and Scales are affected when the layer is resized. (Note: Objects created with the Line, Arrow, Curved Arrow, Box, and Circle tools from the Tools toolbar are not affected by this group.) Select the Scale with Layer Frame radio button to scale the layer elements proportionally with the layer.