KNOWLEDGEBASE - ARTICLE #309

How can I shade the area below the curve on an XY graph?

Prism 4 makes area graphs automatically.

Select to make an Area Fill graph from the Welcome screen.

Prism automatically creates this type of graph. If you need to change the order (which data set is in front), double-click on any dataset to bring up the Format Symbols dialog, and then go to the Order tab.

Prism 3

Creating area graphs requires a work-around in Prism 3. Suppose you want "area" curves for the following data sets:

For this example, we'll connect the data points with straight lines, but you could apply this technique to fitted curves as well. For point-to-point connecting lines, set up a "Fit spline/LOWESS" analysis, choosing the "Point-to-point" method and checking the option to "Show the table of XY coordinates". You may also need to increase the "Number of segments" that the point-to-point curve should contain in order to prevent a jagged appearance to the line. Here are the settings:

Prism will produce a table of XY coordinates for each connecting line. To view the coordinates, select the "Curve" view of the results sheet:

You'll need to plot these coordinates in order to get connecting lines.

Important note: You don't need to do this just to connect points on a LINE graph, which is a simple "Format.. Symbols and Lines" operation--this procedure is only necessary to create an AREA graph.
Copy/paste the coordinates from the results sheet to a new table. Transfer the entire columns--there are many more coordinates than original data points. Only the first few rows of the new data table are shown here:

Now make a new graph of this data. But before you do, if you have more than one data set, as in this example, you may wish to consult the default graph for your original data table to decide which data set you want to be "on top" in your area graph. Double click in the plot area to open the "Format Graph" dialog, the choose "Add..." to select your data sets (make sure that the upper drop-down list, labeled "Select from the following data or results table" is set to the new table containing the pasted coordinates.

For maximum visibility, add data sets to the new graph one at a time, starting with those containing the lowest-value points overall. The first data set that you put on the graph will be "on top of" (or "in front of") the other data sets; each successive data set will be plotted beneath the previous one. This isn't immediately apparent, since the graph will initially show "lines"consisting of many individual symbols:

To convert to an area graph, do the following for each data set: Double click on one of the lines to open the "Format Symbols and Lines" dialog. Change the symbol shape to a spike (bar)--one of the last four choices. Pick the color you want. Finally, choose the symbol size (effectively the width of the spike; use the smallest width that does not leave gaps between the spikes. In this example, a size of zero works because the "point-to-point" curve generated from the XY coordinates from the spline/LOWESS analysis contains a large number of segments and, hence, a large number of spikes). Here are the settings for Data set A in our example:

Here is the finished graph:



Keywords: area plot

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.