SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

DUMBBELL PLOT

Name:
    DUMBBELL PLOT
Type:
    Graphics Command
Purpose:
    Generates a dumbbell plot.
Description:
    Dumbbell plots are used to show the difference between two different groups. They are similar to, but distinct from, I plots. The I plot shows the minimum, the median and the maximum for one or more groups of data. The dumbbell plot shows the values for a set of paired data observations.

    The appearance of the plot is controlled by the first four settings of the LINE and CHARACTER commands (and the associated attribute setting commands). Specifically, given the paired variables Y1 and Y2

    1. Trace 1 contains the observations from Y1.
    2. Trace 2 contains the observations from Y2.
    3. Trace 3 contains a line from the observations in Y1 to the observations in Y2 for the cases where the Y1 value is less than or equal to the Y2 value.
    4. Trace 4 contains a line from the observations in Y1 to the observations in Y2 for the cases where the Y1 value is greter than the Y2 value.

    This is demonstrated in the Program example below.

    Note that dumbbell plots are often drawn horizontally rather than vertically. This can be controlled with the HORIZONTAL SWITCH command.

Syntax 1:
    DUMBBELL PLOT <y1> <y2>             <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    For this syntax, the x-axis value is simply the sequence number.

Syntax 2:
    DUMBBELL PLOT <y1> <y2> <x>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
                <x> is the horizontal axis variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    DUMBBELL PLOT Y1 Y2
    DUMBBELL PLOT Y1 Y2 X
    DUMBBELL PLOT Y1 Y2 SUBSET Y1 > 0 SUBSET Y2 > 0
Note:
    The DUMBBELL PLOT can be used to generate range bar plots (also called span plots or floating bar charts). This plots a bar between the minimum and maximum value. These plots can be used to show how a response varies over time. They can also be used to show the range for different categories (e.g., this can be used in project management to show start and stop dates for different components of the project). This plot is demonstrated in the Program 2 example below.
Default:
    None
Synonyms:
    None
Related Commands:
    CHARACTERS = Sets the type for plot characters.
    LINES = Sets the type for plot lines.
    I PLOT = Generates an I plot.
    BOX PLOT = Generates a box plot.
    PLOT = Generates a data or function plot.
Applications:
    Data Analysis, Presentation Graphics
Implementation Date:
    2025/05
Program 1:
     
    . Step 1:   Create some data - from
    .           https://inforiver.com/insights/dumbbell-charts-game-changer/
    .
    read gdp2021 gdp2022
     4.60    4.70
     6.20    2.40
     4.20    2.20
     3.80    5.10
     5.70    1.60
     6.80    2.50
     7.40    3.60
     4.90    6.20
     1.50    2.80
     3.00    2.10
    end of data
    .
    let string s1  = Austria
    let string s2  = Belgium
    let string s3  = Switzerland
    let string s4  = UAE
    let string s5  = United States
    let string s6  = France
    let string s7  = United Kingdom
    let string s8  = Portugal
    let string s9  = Thailand
    let string s10 = Finland
    let ig = group label s1 to s10
    .
    . Step 2:   Define some plot control
    .
    title case asis
    label case asis
    tic mark label case asis
    .
    let n = size gdp2021
    ylimits 1 n
    major ytic mark number n
    minor ytic mark number 0
    tic mark offset units data
    ytic mark offset 0.5 0.5
    y1tic mark label format group label
    y1tic mark label content ig
    .
    line blank blank solid solid
    line thickness 0.3 all
    line color black black red blue
    character circle circle blank blank
    character hw 1.0 0.75 all
    character fill on on off off
    character color red blue black black
    .
    . Step 3:   Generate the plot
    .
    horizontal switch on
    title GDP Growth Rate for 2021 and 2022
    dumbbell plot gdp2021 gdp2022
        
Program 2:
        . Step 1:   Read data
        .
        skip 25
        read elkins11.dat x y1 y2 y3
        let x = int(x)
        set let cross tabulate collapse
        let y1min = cross tabulate minimum y1 x
        let y1max = cross tabulate maximum y1 x
        let xt    = cross tabulate group one  x
        .
        . Step 2:   Define some plot control
        .
        title case asis
        label case asis
        tic mark label case asis
        .
        let n = size xt
        loop for k = 1 1 n
            let xval = xt(k)
            let string s^k = ^xval
            let xt2(k) = ^k
        end of loop
        let ig = group label s1 to s^n
        ylimits 1 n
        major ytic mark number n
        minor ytic mark number 0
        tic mark offset units data
        ytic mark offset 0.5 0.5
        y1label Year
        y1tic mark label format group label
        y1tic mark label content ig
        x1label Freon-11 Concentration (parts per trillion)
        xlimits 100 300
        .
        bar on all
        bar off off
        bar width 0.8 all
        bar fill on all
        bar color blue all
        line blank all
        .
        . Step 3:   Generate the plot
        .
        horizontal switch on
        title Range Bar Chart of Freon-11 Concentration
        dumbbell plot y1min y1max
        
Date created: 05/22/2025
Last updated: 06/26/2025

Please email comments on this WWW page to [email protected].