How to plot multiple lines in Excel with different X values

How to plot multiple lines in Excel with different X values

The program will plot multiple Y variables against one X variable.   The data for this chart must be in columns with the X variable in the first column.   The Y variables must be in adjacent columns.   An example of how to create this chart is given below for plotting two Y variables against the X variable.

An experiment has been to do to measure the amps from a process over time.   The experimenter wants to compare the measured amps to the theoretical amp.   

1. Enter the data into a worksheet as shown below. The data can be downloaded at this link.

How to plot multiple lines in Excel with different X values
 

2. Select the data and the column headings.

3. Select "Correlation" from the "Statistical Tools" panel on the SPC for Excel ribbon.

4. Select the "Plot Multiple Y Variables Against One X Variable" option and then OK.

5. The following input box is used to enter the range containing the data and the headings.  The default is the range selected on the worksheet.

How to plot multiple lines in Excel with different X values

  • Enter range: enter the worksheet range containing the data and the headings; the data must be in columns with the x values in the first column followed by the y values in adjacent columns; the default is the range selected on the worksheet.
  • Enter Title and Labels: enter the title, y-axis label, and x-axis label; there is no default title, but the default for the y-axis is "Y" while the default for the x-axis is the first cell in the column containing the x values.
  • Dates of Data Collection: enter the dates of data collection; optional, if printed will appear in the lower left-hand corner of the chart.
  • Select OK to generate the results.
  • Select Cancel to end the program.

The chart generated by the above data are shown below.

How to plot multiple lines in Excel with different X values

One of the most powerful advantages of a chart is its ability to show comparisons between data series, but you’ll need to spend a little time thinking about what you want to show and how to organize it for excellent communication.

Let’s look at the ways that Excel can display multiple series of data to create clear, easy to understand charts without resorting to a PivotChart. These steps will apply to Excel 2007-2013. Images were taken using Excel 2013 on the Windows 7 OS.

Multiple Series Bar and Line Charts

To create an accurate chart, first make sure your data is organized with column headings and is sorted in the best way to clearly tell your story. Make sure all data uses the same scale – you don’t want one column of sales numbers to be in “dollars” and the next represented by fractions of “millions” of dollars for example.

How to plot multiple lines in Excel with different X values

Select the set of data you want charted. In this example, we want to compare the top 5 states by sales volume. Click the type of chart you want to enter on the Insert tab. It will look something like this:

How to plot multiple lines in Excel with different X values

To follow using our example, download the multiple series charts.

You can quickly see that we need to do some cleaning up before we share:

  • Add titles and series labels – Click on the chart to open the Chart Tools contextual tab, then edit the Chart title by clicking on the Chart Title textbox. To edit the series labels, follow these steps:
    • Click Select Data button on the Design tab to open the Select Data Source dialog box.
    • Select the series you want to edit, then click Edit to open the Edit Series dialog box.
    • Type the new series label in the Series name: textbox, then click OK.

How to plot multiple lines in Excel with different X values

  • Switch the data rows and columns – Sometimes a different style of chart requires a different layout of the information. Our default line chart makes it difficult to see how each state has performed over time. Click the Switch Row/Column button on the Design tab and then edit the series labels.

How to plot multiple lines in Excel with different X values

Create a Combo Chart

Sometimes you want to compare two sets of data that aren’t closely related or that would best be represented by different styles. An Excel Combo chart lets you display different series and styles on the same chart. For example, let’s say we’d like to compare the Annual Sales Total with the Top 5 State Totals to see which states are following the overall trend.

To create a combo chart, select the data you want displayed, then click the dialog launcher in the corner of the Charts group on the Insert tab to open the Insert Chart dialog box. Select combo from the All Charts tab.

How to plot multiple lines in Excel with different X values

Select the chart type you want for each data series from the dropdown options. In this example, we’ve made the Annual Total an Area Chart Type and overlaid that on top of the bar types to show how much each State contributes to the whole, and how their trends match.

You can also access the Combo Chart dialog box by clicking the Change Chart Type button on the Design tab.

How to plot multiple lines in Excel with different X values

Bonus Hint: If, as in this example, one series of data is on a scale that renders the rest of the data difficult to read, click Secondary Axis beside the series that is out of scale.

How to plot multiple lines in Excel with different X values

Courses in Customer Service, Excel, HR, Leadership, OSHA and more. No credit card. No commitment. Individuals and teams.


How to plot multiple lines in Excel with different X values

Note: The following procedure applies to Office 2013 and newer versions. Looking for Office 2010 steps?

  1. Select a chart to open Chart Tools.

  2. Select Design > Change Chart Type.

  3. Select Combo > Cluster Column - Line on Secondary Axis.

  4. Select Secondary Axis for the data series you want to show.

  5. Select the drop-down arrow and choose Line.

  6. Select OK.

When the values in a 2-D chart vary widely from data series to data series, or when you have mixed types of data (for example, price and volume), you can plot one or more data series on a secondary vertical (value) axis. The scale of the secondary vertical axis reflects the values for the associated data series.

How to plot multiple lines in Excel with different X values

After you add a secondary vertical axis to a 2-D chart, you can also add a secondary horizontal (category) axis, which may be useful in an xy (scatter) chart or bubble chart.

To help distinguish the data series that are plotted on the secondary axis, you can change their chart type. For example, in a column chart, you could change the data series on the secondary axis to a line chart.

Important: To complete the following procedures, you must have an existing 2-D chart. Secondary axes are not supported in 3-D charts.

You can plot data on a secondary vertical axis one data series at a time. To plot more than one data series on the secondary vertical axis, repeat this procedure for each data series that you want to display on the secondary vertical axis.

  1. In a chart, click the data series that you want to plot on a secondary vertical axis, or do the following to select the data series from a list of chart elements:

    1. Click the chart.

      This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    2. On the Format tab, in the Current Selection group, click the arrow in the Chart Elements box, and then click the data series that you want to plot along a secondary vertical axis.

      How to plot multiple lines in Excel with different X values

  2. On the Format tab, in the Current Selection group, click Format Selection.

    The Format Data Series dialog box is displayed.

    Note: If a different dialog box is displayed, repeat step 1 and make sure that you select a data series in the chart.

  3. On the Series Options tab, under Plot Series On, click Secondary Axis and then click Close.

    A secondary vertical axis is displayed in the chart.

  4. To change the display of the secondary vertical axis, do the following:

    1. On the Layout tab, in the Axes group, click Axes.

    2. Click Secondary Vertical Axis, and then click the display option that you want.

  5. To change the axis options of the secondary vertical axis, do the following:

    1. Right-click the secondary vertical axis, and then click Format Axis.

    2. Under Axis Options, select the options that you want to use.

To complete this procedure, you must have a chart that displays a secondary vertical axis. To add a secondary vertical axis, see Add a secondary vertical axis.

  1. Click a chart that displays a secondary vertical axis.

    This displays the Chart Tools, adding the Design, Layout, and Format tabs.

  2. On the Layout tab, in the Axes group, click Axes.

    How to plot multiple lines in Excel with different X values

  3. Click Secondary Horizontal Axis, and then click the display option that you want.

  1. In a chart, click the data series that you want to change.

    This displays the Chart Tools, adding the Design, Layout, and Format tabs.

    Tip: You can also right-click the data series, click Change Series Chart Type, and then continue with step 3.

  2. On the Design tab, in the Type group, click Change Chart Type.

    How to plot multiple lines in Excel with different X values

  3. In the Change Chart Type dialog box, click a chart type that you want to use.

    The first box shows a list of chart type categories, and the second box shows the available chart types for each chart type category. For more information about the chart types that you can use, see Available chart types.

Note: You can change the chart type of only one data series at a time. To change the chart type of more than one data series in the chart, repeat the steps of this procedure for each data series that you want to change.

When the values in a chart vary widely from data series to data series, you can plot one or more data series on a secondary axis. A secondary axis can also be used as part of a combination chart when you have mixed types of data (for example, price and volume) in the same chart.

In this chart, the primary vertical axis on the left is used for sales volumes, whereas the secondary vertical axis on the right side is for price figures.

How to plot multiple lines in Excel with different X values

Do any of the following:

  1. This step applies to Word for Mac only: On the View menu, click Print Layout.

  2. In the chart, select the data series that you want to plot on a secondary axis, and then click Chart Design tab on the ribbon.

    For example, in a line chart, click one of the lines in the chart, and all the data marker of that data series become selected.

  3. Click Add Chart Element > Axes > and select between Secondary Horizontal or Second Vertical.

  1. This step applies to Word for Mac only: On the View menu, click Print Layout.

  2. In the chart, select the data series that you want to plot on a secondary axis, and then click Chart Design tab on the ribbon.

    For example, in a line chart, click one of the lines in the chart, and all the data marker of that data series become selected.

  3. Click Add Chart Element > Axis Titles > and select between Secondary Horizontal or Second Vertical.