/usr/share/doc/gri/examples/example11.gri is in gri-html-doc 2.12.26-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | # Example 11 -- Fancy plot
.thin. = 0.5 # for whole data set
.thick. = 2 # for bravo time period
.gray_for_guiding_lines. = 0.75 # for guiding lines
.tmin. = 1964 # time axis
.tmax. = 1974
.tinc. = 5
.tincinc. = 1
.missing_value. = -9
\file = "./example11.dat"
#
# Guiding lines to draw on both panels.
#
.1xl. = 1962
.1yb. = -3
.1xr. = 1968
.1yt. = 3
.1slope. = {rpn .1yt. .1yb. - .1xr. .1xl. - /}
.1intercept. = {rpn .1yb. .1slope. .1xl. * -}
.2xl. = 1966.4
.2yb. = 3
.2xr. = 1980
.2yt. = -1
.2slope. = {rpn .2yt. .2yb. - .2xr. .2xl. - /}
.2intercept. = {rpn .2yb. .2slope. .2xl. * -}
#
# PANEL 1: Bravo time period.
#
set x margin 3
set x size 15
set y margin 3
set y size 5
# Draw border big enough for this and next panel.
draw border box {rpn ..xmargin.. 2 -} {rpn ..ymargin.. 2 -} {rpn ..xmargin.. ..xsize.. + 2 +} {rpn ..ymargin.. ..ysize.. 2 * 3 + + 2 +} 0.2 0.75
set missing value .missing_value.
set ignore error eof
set x name "Year"
set x axis .tmin. .tmax. .tinc. .tincinc.
set y name "Area / 10$^5$km$^2$"
set y axis -3 3 1
draw axes
#
# Draw index lines 1 and 2.
#
# Upward sloped line.
set line width .thin.
set graylevel .gray_for_guiding_lines.
if {rpn .1intercept. ..xright.. .1slope. * + ..ytop.. <}
draw line from \
..xleft.. \
{rpn .1intercept. ..xleft.. .1slope. * +} \
to \
{rpn ..ytop.. .1intercept. - .1slope. /} \
..ytop..
else
draw line from \
..xleft.. \
{rpn .1intercept. ..xleft.. .1slope. * +} \
to \
..xright.. \
{rpn .1intercept. ..xright.. .1slope. * +}
end if
set graylevel 0
#
# Downward sloped line.
set line width .thin.
set graylevel .gray_for_guiding_lines.
if {rpn .2intercept. ..xleft.. .2slope. * + ..ytop.. <}
draw line from \
{rpn ..ytop.. .2intercept. - .2slope. /} \
..ytop.. \
to \
..xright.. \
{rpn .2intercept. ..xright.. .2slope. * +}
else
draw line from \
..xleft.. \
{rpn .2intercept. ..xleft.. .2slope. * +} \
to \
..xright.. \
{rpn .2intercept. ..xright.. .2slope. * +}
end if
set graylevel 0
#
# Finally, draw the data curve on top, after first
# whiting out a background.
set input data window x .tmin. .tmax.
open \file
read columns x y
close
y /= 1e5
set line width ..linewidthaxis..
draw zero line
set line width {rpn .thick. 3 *}
set graylevel 1
draw curve
set graylevel 0
set line width .thick.
draw curve
#
# PANEL 2: Longer timescale.
#
delete x scale
set x margin bigger 5
set x size 10
set x name ""
set y name ""
set y margin bigger {rpn ..ysize.. 3 +}
#
# Draw long data set in thin pen.
set input data window x off
open \file
read columns x y
close
y /= 1e5
#
# Draw guiding lines, axes, etc.
set x axis 1952 1980 5 1
draw axes frame
set line width .thin.
set graylevel .gray_for_guiding_lines.
draw line from .1xl. .1yb. to .1xr. .1yt.
draw line from .2xl. .2yb. to .2xr. .2yt.
set graylevel 0
set line width ..linewidthaxis..
draw zero line
draw x axis at bottom
.old. = ..fontsize..
set font size 0
draw y axis at left
set font size .old.
delete .old.
#
# Draw full curve (first whiting out region around it).
set line width {rpn .thin. 4 *}
set graylevel 1
draw curve
set graylevel 0
set line width .thin.
draw curve
#
# Draw bravo time period (first whiting out region around it).
set input data window x .tmin. .tmax.
open \file
read columns x y
close
y /= 1e5
set line width {rpn .thick. 3 *}
set graylevel 1
draw curve
set graylevel 0
set line width .thick.
draw curve
#
# Done
set font size 20
\label = "Example 11 (Arctic ice anomaly)"
draw label "\label" at \
{rpn 8.5 2.54 * "\label" width - 2 /} \
{rpn ..ytop.. yusertocm 0.7 +} \
cm
if !..publication..
draw time stamp
end if
|