You are here:

Advertisement

Hi Damon,

I will appreciate if you could explain how I can create a carpet plot with two independent variables and one dependent variable using excel? Thanks.

Version of Excel: 2010

Level: 7

Hi Emmanuel,

Strictly speaking there is no carpet plot capability in Excel. However, there is contour plot capability which I suspect is what you actually have in mind. An example of a contour plot would be a map with lines or colors indicating different terrain elevation levels.

To do a contour plot you need to have your data in table form, with the x-axis grid values along the top row of the table and the y-axis grid values beside the leftmost column of the table. An example would be for the map I mentioned where the top row would be latitude values, the first column would be latitude values, and the interior of the table would be elevation values.

Once you have the data in this form, select the table (including grid values) and then use Insert > Chart to create your chart. At this point you will have the option to select the chart type. Select Contour (next to the 3-D surface type).

Unfortunately the Excel capability to do contour plots is neither very powerful nor user-friendly, with with a bit of work (and usually some trial-and-error) you can usually get approximately what you want. I have found I generally have to edit the names of the data series' (usually the table row data) to get the names consistent with the actual data values. In addition you will generally need to edit the z-axis increment to get the contours to have the intervals you want because Excel does not seem to choose the increment very intelligently. The easiest way to do this is to change the chart from a Contour chart type to a 3-D chart type. Then you can select the z-axis (which represents the table values) and set its max, min, and increment values. Then you can change the chart back to a Contour chart type. Sometimes it is actually easier to set it up originally as a 3-D Surface chart type and when you get everything set up (axes increments and labeling, etc.) then you can switch it to a Contour type.

I hope you find this helpful.

Damon

- Add to this Answer
- Ask a Question

Rating(1-10) | Knowledgeability = 9 | Clarity of Response = 6 | Politeness = 9 |

Comment | No Comment |

This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

Answers by Expert:

I have extensive experience with VBA programming in Excel 5 through Excel 2013. As a former aerospace engineer with a large aerospace corporation and consultant in a small defense technology services company, I have developed a wide range of applications in VBA, including simulations involving mixed-language programming, satellite orbit mechanics, graphics and animation, and real-time applications. I am interested in moderate to hard VBA-related questions only.

I have developed and taught several courses in Excel VBA programming and also VBA programming in Office 97, 2000, and 2007. I have developed a number of large technical applications in Excel VBA for use within the aerospace industry.**Education/Credentials**

B.S. in Electrical Engineering and Computer Science, University of California, Berkeley.