The Contour Plot tool can be used to create a contour and 3D surface plot for the given data points. These plots can help visualize the data in 2/3 dimensions. Contour Plot is typically used to plot data for the continuous data type where the output is a function of two input variables.
This tool can be added to your active workbook by clicking on Graph and then selecting Contour Plot.
Inputs
Click on Analysis Setup to open the menu options for this tool.
Setup
A sample screenshot of the setup menu is shown below.
1
Chart Type:
Specify the type of chart to create. The following options are available:
Option
Description
Contour
Create a 2D contour plot of the data. Note that the contour plot is created as a projected top-view of a surface plot.
Surface
Create a 3D surface plof of the data.
2
Num Levels:
Specify the number of contours or levels that should be shown on the plot. If you set the value as Auto the system will pick an appropriate number of levels. You can pick up to 20 levels for this plot.
3
Colors:
Specify the colors to use for the contours. If you set the value as Auto the system will pick the default colors otherwise it will use the color index you specify.
4
Legend:
Specify if you want to display the legend on the chart. The available options are:
Option
Description
None
Do not display any legend on the chart.
Bottom
Display the legend at the bottom of the chart.
Left
Display the legend on the left side of the chart.
Right
Display the legend on the right side of the chart.
Top
Display the legend on top of the chart.
5
Help Button:
Click on this button to open the help file for this topic.
6
Cancel Button:
Click on this button to discard any changes and close the dialog box.
7
OK Button:
Click on this button to save any changes and compute the analysis outputs if possible.
Data
If you click on the Data button, you will see the following dialog box. Here you can specify the data required for this analysis.
1
Variable Names:
Specify the names for the X variable, Y variable, and the Z variable. Make sure that you do not have any special characters or spaces in the name. The default names for these variables are X, Y, and Z.
2
X Values:
Specify the minimum, increment, and maximum values for the X axis. Use a reasonable number so that you get a good resolution for the contour plot while keep the total number of iterations low. The default value is to have 10 intervals between the minimum and maximum values.
3
Y Values:
Specify the minimum, increment, and maximum values for the Y axis. Use a reasonable number so that you get a good resolution for the contour plot while keep the total number of iterations low. The default value is to have 10 intervals between the minimum and maximum values.
4
Z Equation:
Specify the equation that relates the Z variable to the X and Y variables. This equation will be used to generate the data points for the contour plot. You can use any valid mathematical equation such as sin(X) + Y^2 etc.
Charts
If you click on the Charts button, you will see the following dialog box.
1
Title:
The system will automatically pick a title for your chart. However, if you would like to override that with your own title you can specify a title for your chart here. Note that this input is optional.
2
Sub Title:
The system will automatically pick a subtitle for your chart. However, if you would like to override that with your own subtitle you can specify a subtitle for your chart here. Note that this input is optional.
3
X Label:
The system will automatically pick a label for the x-axis. However, if you would like to override that with your own label for the x-axis you can specify a different label here. Note that this input is optional.
4
Y Label:
The system will automatically pick a label for the y-axis. However, if you would like to override that with your own label for the y-axis you can specify a different label here. Note that this input is optional.
Verify
If you click on the Verify button, the software will perform some checks on the data you have entered. A sample screenshot of the dialog box is shown in the figure below.
The objective of this analysis as well as any checks that are performed is listed in this dialog box. For example, the software may check if you have correctly specified the input options and entered the required data on the worksheet. The results of the analysis checks are listed on the right. If the checks are passed, then they are shown as a green-colored checkmark. If the verification checks fail, then they are shown as a red-colored cross. If the verification checks result in a warning, they are shown in the orange color exclamation mark and finally, any checks that are required to be performed by the user are shown as blue info icons.
Outputs
Click on Compute Outputs to update the output calculations. A sample screenshot of the worksheet is shown below.
>
Notes:
The text output of the analysis is sent to the notes section. This section contains the minimum, number of increments, and maximum X and Y values. It also specifies the formula defined to calculate the Z values (if specified). The Analysis Results section contains the name of the Z variable and the minimum, maximum and average values of the Z values.
>
Graphs:
The graphs section contains the contour and surface plot of the given data set. You can use the Excel functionality to rotate the graph as required.
Notes
Here are a few pointers regarding this analysis:
The background color of the graph can be changed by clicking the Options button in the Sigma Magic software. However, most formatting can be accomplished by using the standard Excel functions to format the graph. For example, you can change the orientation view of the graph using Excel. Please note that if you click on Compute Outputs again any formatting you do with the Excel functions will be lost.
You can change the orientation of the chart using Excel to view it from the top. In Excel 2007, you can change the view by clicking on the graph and then selecting Layout, 3-D Rotation, and setting the X angle to 0 degrees and Y angle to 90 degrees. This results in a traditional 2D contour plot.
The name of the X and Y variables have to be unique and cannot contain special characters like spaces, commas, plus sign, percentage sign, minus sign, division sign, etc. This is to ensure that there are no errors in calculations for the Z if a formula is defined.
Note that variables names are not case sensitive. A variable named X is the same as x. You can either use X or x in the formula for Z.
Once you define the variables in the dialog box and click on OK, the worksheet is updated. Any values you have already defined in the worksheet are cleared and over-written. This is to ensure that your analysis does not get corrupted with older values.
Examples
Following examples can be found in the Examples folder.
Create a contour plot for the function Z = sin^2(x) + cos^2(y) for x and y values between 0 and 360 degrees (Optimization Equation 1.xlsm).
Create a contour plot for the function Z = 2x^2 + 2y^2 - 4 to determine its minimum value (Optimization Equation 2.xlsm).
Create a contour plot for the function Z = x^2+2xy+y^2-2x-3 to visualize the shape of the function (Optimization Equation 3.xlsm).