|
BULLET PLOTName:
The appearance of the plot is controlled by the settings for the bar and character commands. This is demonstrated in the Program examples below. Specifically,
<SUBSET/EXCEPT/FOR qualification> where <y> is the response variable; <ytarg> is a variable containing the target value; <yback> is a variable that contains the levels for the background bars; and where the <SUBSET/EXCEPT/FOR qualification> is optional. The <y> and <ytarg> variables must have the same number of observations.
. Step 1: Create the data
.
skip 25
read gear.dat y x
skip 0
set let cross tabulate collapse
let ymean = cross tabulate mean y x
let n = size ymean
.
. Step 2: Plot control
.
title case asis
label case asis
legend case asis
.
horizontal switch on
ylimits 1 n
major ytic mark number n
minor ytic mark number 0
tic mark offset units data
y1tic mark offset 0.8 0.8
y1label Batch
x1label Mean Diameter
xlimits 0.98 1.01
x1tic mark offset 0 0.005
.
line blank all
character blank all
character blank circle
character color black red
character hw 1.0 0.75 all
character fill off on
.
bar on off on on on
bar fill on off on on on
bar fill color black black g90 g60 g30
bar width 0.6 all
bar width 0.3
bar base 0.98 0.98 0.98
.
let ytarg = 1 for i = 1 1 n
let yrange = data 0.99 1.0 1.01
.
title Bullet Plot (GEAR.DAT)
bullet plot ymean ytarg yrange
Program 2:
. Step 1: Create the data - example from Wikipedia
.
let y = data 270
let ytarg = data 260
let yback = data 200 250 300
.
. Step 2: Plot control
.
title case asis
label case asis
legend case asis
.
horizontal switch on
ylimits 0 2
y1tic marks off
y1tic mark labels off
xlimits 0 300
major xtic mark number 7
minor xtic mark number 0
tic mark offset units data
x1tic mark offset 0 10
.
multiplot corner coordinates 5 5 90 90
multiplot scale factor 2
multiplot 2 1
frame corner coordinates 30 20 95 90
x2frame off
yframe off
.
line blank all
character blank all
.
bar on on on on on
bar fill on on on on on
bar fill color black black red orange green
bar width 1.0 all
bar width 0.3 0.8
let ytarg = ytarg + 2
bar base 0 258
.
legend justification center
legend 1 coordinates 15 55
legend 1 Revenue 2024 YTD
legend 1 size 3
legend 2 coordinates 15 45
legend 2 (US$ in Millions)
legend 2 size 1.5
.
bullet plot y ytarg yback
bar fill color black black g30 g60 g90
bullet plot y ytarg yback
.
end of multiplot
justification center
move 50 95
text Example of Bullet Plot
Date created: 06/10/2025 |
Last updated: 06/10/2025 Please email comments on this WWW page to [email protected]. | ||||||||||||||||