Shade Between Two Curves


This macro creates a shade between two curves. It complements SigmaPlot’s built-in area plot feature that shades area under the curve to the X-axis. The macro assumes the data for both curves is strictly increasing in x.

The data format is two XY pairs. The same X column would be used for the 2nd curve (i.e. X1Y1, X1Y2).

For a Solid color between the curves, use a large line density, about 500. For a nicely spaced vertical fill, try a density of 50.

New Graph Page:

To Create a new graph page, select the “Shade New Graph” radio button.

Select Enter Range if you wish to shade over a sub-range of the data. Enter x values in the From and To fields to do this.

Use a right mouse click and the Bring to Front or Send to Back options to place the shade in front or behind the plot lines.

It will turn off the legend for the new graph. To turn the legend back on, go to the Graph Properties, Graph, Legends and check the “Show Legend” check box.

Existing Graph:

Select the Shade Existing Graph radio button to add a shade to an existing graph.

Create a shade for a sub-region of x by selecting the shade range to be 1.5 to 4.4.

Existing Graph:

The example to the right uses two different shade regions identified by the two shades of gray. This was done by using the macro twice specifying a different shade range each time (1 to 1.5) and (1.5 to 4.4).

Download the file and double click on it to obtain the SigmaPlot notebook containing this macro. See Installing a Macro to install and use this macro.

Try SigmaPlot FREE for 30 Days!