Excel 2010 Bible

(National Geographic (Little) Kids) #1

Chapter 19: Learning Advanced Charting


479


Plotting mathematical functions with two variables

The preceding section describes how to plot functions that use a single variable (x). You also can
plot functions that use two variables. For example, the following function calculates a value of z
for various values of two variables (x and y):

z = SIN(x)*COS(y)

Figure 19.41 shows a surface chart that plots the value of z for 21 x values ranging from 1 to 5 ,
and for 21 y values ranging from 1 to 5. Both x and y use an increment of 0.2.

The formula in cell B2, copied across and down, is

=SIN($A2*COS(B$1))

On the CD
The companion CD-ROM contains a general–purpose, two-variable plotting application. The file is named
function plot 3D.xlsm. This workbook contains a few simple VBA macros to allow you to change the
chart’s rotation and elevation. n


FIGURE 19.41

Using a surface chart to plot a function with two variables.

Free download pdf