Example: Create a Grouped Series Plot

About This Example

In this example, you create a series plot with grouped data. You also do the following:
  • change a plot line property
  • customize the title and remove the footnote
  • add and reposition a discrete legend
Here is the graph that you create in this example:
Grouped Series Plot
Grouped Series Plot
There are several ways to create and customize this graph. The following steps show one way to create the graph.

Step One: Create the Graph and Assign Data

To create the graph and assign data:
  1. Open the Graph Gallery if it is not already open. For instructions, see Open and Use the Graph Gallery.
  2. On the Basic tab, double-click the SeriesPlot icon. The Assign Data dialog box appears.
  3. In the Assign Data dialog box, complete these steps:
    • Select SASHELP from the Library list box.
    • Select STOCKS from the Data Set list box.
    • Select DATE from the X list box.
    • Select CLOSE from the Y list box.
    • Select STOCK from the Group list box.
  4. Click OK.

Step Two: Change a Plot Line Property

Change the line properties of the plot so that all the lines are solid. The lines obtain their appearance from the style element for the group. By changing the line properties, you override that style element.
To change the line properties:
  1. Right-click anywhere within the plot area and select Plot Properties. The Cell Properties dialog box appears and displays the Plots tab.
  2. From the Plot list box, select series if it is not already selected.
  3. From the Pattern list box, select the solid line.
    By default, Group is selected. This selection indicates that the value is derived from the group variable. When you explicitly change the pattern, you override the default value.
  4. Click OK.

Step Three: Customize the Title and Remove the Footnote

To customize the title and remove the footnote:
  1. Double-click the placeholder title. The placeholder text is highlighted:
    title text box
  2. In the text box, enter Stock Trend.
  3. In the bottom left corner of the graph, right-click the placeholder footnote and select Remove Footnote from the pop-up menu.

Step Four: Add and Reposition a Discrete Legend

To add and reposition a discrete legend:
  1. Click and drag the Discrete Legend icon from the Insets panel to the bottom of the plot area. The legend is placed near the X axis (where you dragged it).
  2. Right-click the legend and select Legend Properties. The Legend Properties dialog box appears.
  3. From the Position list box, select Top Left, and then click OK.
    The legend is moved to the top left corner of the graph.