Sei sulla pagina 1di 13

# R. D.

Busch, 2001

## UNM ChNE-231, Page XLC-1

Module XLC - Additional Information on Graphs in EXCEL Learning Objectives After completing this module, the student should be able to: 1. 2. 3. 4. 5. Plot multiple data sets on one graph. Change Titles and Axis Labels. Make x-y scatter the Default Chart. Add text and lines to a chart. Create a second y-axis for mixed data.

## Assignments 1. Read the information in this module.

R. D. Busch, 2001

## Module XLC - Additional Information on Graphs in EXCEL

Plotting Multiple Data Sets on One Graph Sometimes the x-data and the y-data are not in adjacent columns, but you want to plot them on the same chart. You can do this by selecting the x column first and then hold the control key while selecting the y column. 1. Load the xlgraphexamples.xls workbook. 2. Select Sheet 7, which should be a four-column spreadsheet with column titles and 20 sets of X,Y1,Y2,Y3 points. (Note that although this data is labeled as a radioactive decay chain, it could just as easily be data for component concentrations in a series of chemical reactions. In both cases, the governing equations are the same.) 3. Now use the mouse to highlight the first column and 21 rows. Then, holding down the Ctrl (control) key, use the mouse to highlight the third column with the data for Isotope B. The first and third columns should be highlighted. 4. Now click on the chart wizard icon and create a chart as before (Chart 7). It should look something like this.
2.5

Activity (dps)

1.5

Activity B, dps 1

0.5

0 0 5 10 15 20 25 30 35 40 45 Time (seconds)

R. D. Busch, 2001

## Module XLC - Additional Information on Graphs in EXCEL

Now to add additional curves, do the following: 1. While on Chart 7, click on Chart and then on Add Data. This will bring up a box labeled ADD DATA. 2. Then select Sheet 7 where the data is. 3. Using the mouse, highlight Column 4 with Isotope C data. Then click OK. 4. The chart should have two sets of data distinguished by color. 5. Repeat the process and add the second column with Isotope A data. 6. To change the symbol for a given data set, double click on one of the points of the data set. 7. Select the Patterns tab. From this tab you can change the marker symbol, color, or add a line to the chart. Note that adding a line is not the same as adding the trendline. A line simply connects each data point but is not a best fit. After you add a line for each data set, your graph should look like:
6

## Activity B, dps 3 Activity C, dps Activity A, dps

0 0 5 10 15 20 25 30 35 40 45 Time (seconds)

R. D. Busch, 2001

## UNM ChNE-231, Page XLC-4

Module XLC - Additional Information on Graphs in EXCEL You can make the lines wider or narrower from the Patterns tab using the selections under weight.

Now let's change the title and the y-axis label to make this a graph of chemical component concentration in a series reaction. First, click on the graph title and edit it to read Concentration of Chemical Components in a Series Reaction. Then click on the y-axis label and edit it to read Concentration (moles/liter). Note that after you are done editing, you click outside the text box rather than using Enter. If you press Enter, this will give a new line within the text box and won't take you out of edit. Because we added the data to the graph in a strange order, the listings in the legend are not alphabetical. To reorder these labels, double click on any one curve, which should bring up the Format Data Series screen. Then select the Series Order tab. For our particular case, we need to move the label for A to the top above B and C. Select the label for A and then click on Move Up; then click on Move Up again. This should put the labels in the desired order.

R. D. Busch, 2001

## Module XLC - Additional Information on Graphs in EXCEL

Finally, we need to change the label for each curve so that they read concentration of A, B, or C. This is done by clicking on the curve. If we select the one currently labeled Activity A, then we should see the following description in the formula bar: =SERIES(Sheet7!R1C2,Sheet7!R2C1:R21C1,Sheet7!R2C2:R21C2,1) This description has three arguments: 1. the first indicates the name of the series (in this case the name is pulled from cell R1C2 {or C1 in the default format} on sheet 7. 2. the second indicates the location of the independent variable data (in this case the data is pulled from cells R2 to R21 of Column 1 {or A2:21 in the default format} on sheet 7. 3. the third indicates the location of the dependent variable data (in this case the data is pulled from cells R2 to R21 of Column 2 {or B2:21 in the default format} on sheet 7. To change the series name, replace Sheet7!R1C2 with "conc. A". If you are labeling a series with text, then it must be enclosed in quotation marks; otherwise Excel assumes it is a cell location reference. Repeat the process for the second and third series changing their names to "conc. B" and "conc. C" respectively. At this point your sheet should look like:

R. D. Busch, 2001

6

## 4 conc. A 3 conc. B conc. C 2

0 0 5 10 15 20 25 30 35 40 45 Time (seconds)

Adding Text and Arrows to your Chart Sometimes you need to annotate your chart by adding text and or arrows to the plot. To do this you need the Draw toolbar on screen. If it is not on screen, select View, and then Toolbars, and then Drawing. This will put the Drawing toolbar at the bottom of the screen. To add text, select the text box icon, which looks like a square with the letter A and some lines in it. Then use the mouse to select the area that you want to open the text box. Click the left mouse button and drag the box to the approximate size desired. Then type in your text. For this example, we want to put text close to the end of curve C. The text should say, Note that C has not reached final concentration of 5 moles/liter at 40 seconds into reaction. After you have typed the text in, double click on the outside edge of the text box. This will bring up the Format Text Box screen as shown. To put the text on top of the graph, you need to change the Background from Transparent to Opaque. (see Figure below). Then click OK.

R. D. Busch, 2001

## Module XLC - Additional Information on Graphs in EXCEL

Using the Drawing Toolbar you can also add arrows to the plot to connect text boxes with graph features. Select the arrow icon and move the cursor to where you want the arrow to start. Click the left mouse button and move to where you want the arrow to end (where the arrowhead will be.) For this exercise, put a text box near the upper center of the chart that says, Maximum Concentration of B occurs about 12 seconds. Then draw an arrow from the peak of curve B to the middle of the text box. After making the text box opaque, the chart should look like that on the next page.

R. D. Busch, 2001

6

## Maximum Concentration of B occurs about 12

Note that C has not reached final concentration of 5 moles/liter at 40 seconds into reaction.
conc. A

conc. B conc. C

0 0 5 10 15 20 25 30 35 40 45 Time (seconds)

MAKING X-Y SCATTER YOUR DEFAULT CHART If you are working on your own computer, you might want to make the x-y scatter chart the default chart. This means that every time you select chart wizard, the x-y scatter chart should be selected as the chart type. To do this you first need to create a chart or use an x-y scatter chart that you have previously created. Once you have a chart and have selected it, the Chart option should appear on the Menu bar. Select the Chart option and then select Chart Type. This should bring up the chart types listing. Select x-y scatter if it isn't already selected. Then the option Set as Default Chart should be available in the bottom left-hand corner of the screen. Select this option and x-y scatter should become your default chart type.

R. D. Busch, 2001

## Module XLC - Additional Information on Graphs in EXCEL

R. D. Busch, 2001

## UNM ChNE-231, Page XLC-10

Module XLC - Additional Information on Graphs in EXCEL Plotting Mixed Data Sets on One Graph When the range of values for different data series varies widely, or when you have mixed types of data, you can plot one or more data series on a secondary y-axis. The scale of the secondary axis reflects the values for the associated series. The chart in the example above shows the number of homes sold on the left y-axis and the average price on the right y-axis. Plotting A Data Series on a Secondary Axis When the range of values for different data series in a 2-D chart varies widely, or when you have mixed types of data (such as price and volume), you can plot one or more data series on a secondary value (y) axis. The scale of the secondary axis reflects the values for the associated series. 1. 2. 3. Load the xlgraphexamples.xls workbook. Select Sheet 8, which should be a three-column spreadsheet with column titles and 11 sets of X, Y1, Y2 points. Now use the mouse to highlight rows 3 through 11 of all three columns. Now click on the chart wizard icon and create a chart as before (Chart 8). Give it a title of Effect of Moderator in C-UO2 system, an x-axis label of Atoms C to Atoms UO2 and a y-axis label of Cylinder radius (cm). Then change the y-axis to logarithmic. When done, it should look something like this.
Effect of Moderator in C-UO2 System 10000.0

100.0

Series1 Series2

10.0

1.0 0 500 1000 1500 2000 2500 3000 3500 4000 4500 Atom s C to Atom s UO2

R. D. Busch, 2001

## Module XLC - Additional Information on Graphs in EXCEL

Note that although both dependent variables (cylinder radius and k-infinity) are related to the independent parameter (moderator ratio), the values in each data series are significantly different. Even with the logarithmic scale, it is difficult to see the variation in k-infinity with moderating ratio. This is a situation where the addition of a secondary y-axis will make it easy to see variations in both data series. Lets put the k-infinity data on a secondary y-axis (this will appear on the right-hand side of the graph). To do so: 1. Single click on the second data series (k-infinity data). 2. On the Format menu, click Selected Data Series (see below)

3. Then click the Axis tab. 4. Click Secondary axis. The graph should look like the figure on the next page.

R. D. Busch, 2001

## Module XLC - Additional Information on Graphs in EXCEL

5.

Click OK and the new chart should have both a left and right y-axis.

Note that after adding the secondary y-axis, the range of the radius series is too large. Click on the left-hand y-axis and change the minimum to 100. Then click on the right-hand yaxis, change the format of the numbers on the right-hand y-axis to have two decimal places, and change to a range of 1.0 to 1.4. If you add y-gridlines to the graph, they will be based on the leftside y-axis. Finally, add labels to each data series, Radius for the first series and k-inf for the second series. The final graph should look something like the figure on the next page.

R. D. Busch, 2001

## Effect of Moderator in C-UO2 System 10000.0 1.30

1.25

1000.0

1.15

1.10

1.05

100.0 0 500 1000 1500 2000 2500 3000 3500 4000 Atoms C to Atom s UO2

1.00 4500

For clarity, you can add an arrow to each data series indicating its related axis. This is done as described on page 6 of this module.