Rectangular zones in graphs
Martin Michel <[email protected]> Sun, 24 May 2020 21:57:11 +0200
| Newsgroups | gmane.comp.type-setting.lout |
|---|---|
| Message-ID | <[email protected]> |
Hi there,
I want to highlight a certain "corridor" in a graph. In other words, a
zone in the range [y1:y2] should have a different colored background or
be overlayed by a semi-transparent box. I wonder if that is possible at
all with the Lout @Graph and @Diag calls. The user manual states it is
possible to place any arbitrary object in a grap, however, I have a hard
time figuring out how this should work. I even fail to draw a box inside
the graph, see this try expanding the example of the manual. My task is to
mark the band between 4 and 5 on the y-axis, but using @Node outline and
@Link fails with `undefined error: unknown or misspelt label? Command:
A` when piping the lout output to ps2pdf. Is this approach correct at
all or do I have to use @Box, other coordinates … ?
@SysInclude { graph }
@SysInclude { diag }
@SysInclude { doc }
@Doc @Text @Begin
@Diag {
@Graph
abovecaption { New South Wales road deaths, 1960--1990
(fatalities per 100 million vehicle km) }
objects {
@CTR at { 1960 4 } { A:: @Node outline {} }
@CTR at { 1990 4 } { B:: @Node outline {} }
@CTR at { 1990 5 } { C:: @Node outline {} }
@CTR at { 1960 5 } { D:: @Node outline {} }
}
{
@Data points { plus } pairs { dashed }
{ 1963 5.6 1971 4.3 1976 3.7 1979 3.4 1982 2.9 1985 2.3 1988 2.0 }
}
@Link from { A } to { B }
@Link from { B } to { C }
@Link from { C } to { D }
@Link from { D } to { A }
}
@End @Text
Any help is welcome, thanks for it in advance!
−Martin