1.173 FAQ-840 How to add recession bars on a 2D graph?

Last Update: 10/6/2021

When plotting economics data, you may wish to add "recession bars" -- shaded vertical bars -- to demarcate periods of recession. Origin has two methods for adding recession bars to a 2D plot.

FAQ840 sample recession bar graph.png

Using the Line Tab "Fill Area Under Curve" Controls

A second "dummy" XY line plot is added to the window containing the curve of interest. The dummy plot is created using an XY dataset where X marks the start and end of the recession period and Y will be something like the maximum vertical scale value.

There are two such data arrangements that will work. Both work in conjunction with the Plot Details Line tab Fill Area Under Curve drop-down list:

  • Span vertically broken by missing values -- the arrangement shown in columns C(X2) and D(Y2), below. This arrangement depends on missing values -- note the blank cells -- to break the plot into recession periods.
  • Span vertically pairwise -- the arrangement shown in columns E(X3) and F(Y3), below. Rather than using missing values to demarcate recession periods, this arrangement just assumes that alternating (i.e. "pairwise) values in the X column, mark the beginning of each recession period.


FAQ840 Fill Area Data Arrangements.png


Recession Bar Method1.png

To assign a different color to each recession bar, go to the Plot Details Pattern tab and under Fill, click the Color button. This opens the Color Chooser where you will click the By Points tab, set the Increment from radio button and choose your starting color.


For more information, see these topics:

Using the Axis Dialog "Reference Line" Tab Controls

Recession Bar Method2.png
See this example for more details.

Keywords:recession bar, fill breaks, vertical bar, periods of recession, economics data

Minimum Origin Version Required: 2017 SR0