Professional Documents
Culture Documents
Automated Graphs Making
Automated Graphs Making
Automated Graphs Making
Roman Putanowicz
Institute of Computer Methods
in Civil Engineering (L-5)
Cracow University of Technology
<R.Putanowicz@L5.pk.edu.pl>
October 19, 2009
What is this
This file is an exercise in automated graph making. When I talk to students about Linux, text
tools, LATEX, and generally about UNIX philosophy of working, in many cases I see that
they politely accept my arguments, though they would prefer something more substantial,
something they could try themselves. So to strengthen my arguments I came with his little
exercise:
From the data, which can be downloaded from http://www.L5.pk.edu.pl/~ putanowr/
casesData.zip, create a document which looks exactly like this one (except this
introductory section).
1.1
Setup
There are 50 files. Each data file consist of two columns with 50 X-Y values. From that
values a graph is created by simply joining the points with segments. For each graph the
minimum and maximum Y value is found, and at the corresponding data point a box is
plotted highlighting the value. The X and Y values in the box are formatted with the
format %5.2f. Additionally the graph function is integrated using the trapezoidal rule and
the integral value is displayed in the centre of the graph.
1.2
Solution
My result in preparing the graphs was 3.5 hours including refreshing my knowledge of gnuplot
and some LATEX tools. I have used gnuplot, AWK, bash, LATEX and octave. All scripts,
including the one used for preparing data files, can be downloaded from http://www.l5.
pk.edu.pl/casesScripts.tar.gz. Mind however, that the scripts are rather quick and
dirty solution and not the best example of programming style.
1.3
Disclaimer
This exercise and my results do not poof absolute value of any tool or specific
working strategy. There is nothing like that, as you can always come with an
example where a different set of tools and a different working strategy would
be more appropriate. And this is exactly the point I would like to make it is
worth to know alternatives, even if they seem much unusual comparing to what
we are used to.
1
max0.91.00, 0.90
case01
0.8
0.7
0.6
0.5
Calculated with trapezoidal rule:
Z 2.00
fcase01 (x)dx = 0.258701
0.4
1.00
0.3
0.2
0.1
0
-0.1
min 1.49,-0.10
-0.2
1
1.2
1.4
1.6
1.8
2
case02
max 1.24, 1.85
1.8
1.6
1.4
1.2
1.00
0.8
0.6
0.4
0.2
0
min 1.76,-0.15
-0.2
1
1.2
1.4
1.6
1.8
1.2
case03
max 1.49, 1.06
1
0.8
0.6
0.4
0.2
1.00
0
-0.2
-0.4
-0.6
-0.8
min 1.16,-0.94
-1
1
1.2
1.4
1.6
1.8
1.4
case04
1.2
1
0.8
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase04 (x)dx = 0.360030
0.4
1.00
0.2
0
-0.2
-0.4
-0.6
min 1.88,-0.64
-0.8
1
1.2
1.4
1.6
1.8
1.8
case05
max 1.31, 1.62
1.6
1.4
1.2
1
0.8
1.00
0.6
0.4
0.2
0
-0.2
min 1.10,-0.38
-0.4
1
1.2
1.4
1.6
1.8
1.2
case06
0.2
1.00
0
-0.2
-0.4
-0.6
-0.8
min 1.92,-0.92
-1
1
1.2
1.4
1.6
1.8
1.8
case07
1.6
1.4
1.2
1
Calculated with trapezoidal rule:
Z 2.00
fcase07 (x)dx = 0.688681
0.8
1.00
0.6
0.4
0.2
0
-0.2min 1.06,-0.20
1
1.2
1.4
1.6
1.8
0.2
1.00
0
-0.2
-0.4
-0.6
-0.8
min 1.94,-0.92
-1
1
1.2
1.4
1.6
1.8
1.8
case09
0.8
1.00
0.6
0.4
0.2
0
-0.2
min 1.06,-0.27
-0.4
1
1.2
1.4
1.6
1.8
2
case10
max 1.45, 1.82
1.8
1.6
1.4
1.2
1.00
0.8
0.6
0.4
0.2
0
-0.2
1
1.2
1.4
min 1.55,-0.18
1.6
1.8
1.8
case11
max 1.14, 1.65
1.6
1.4
1.2
1
0.8
1.00
0.6
0.4
0.2
0
-0.2
min 1.41,-0.33
-0.4
1
1.2
1.4
1.6
1.8
2
max 1.04, 1.93
case12
1.8
1.6
1.4
1.2
Calculated with trapezoidal rule:
Z 2.00
fcase12 (x)dx = 0.931767
1.00
0.8
0.6
0.4
0.2
0
min 1.96,-0.07
-0.2
1
1.2
1.4
1.6
1.8
1.6
case13
0.6
1.00
0.4
0.2
0
-0.2
-0.4
min 1.35,-0.45
-0.6
1
1.2
1.4
1.6
1.8
0.2
1.00
0
-0.2
-0.4
-0.6
-0.8
min 1.10,-0.88
-1
1
1.2
1.4
1.6
1.8
1.6
case15
0.6
1.00
0.4
0.2
0
-0.2
-0.4
min 1.16,-0.49
-0.6
1
1.2
1.4
1.6
1.8
1.6
case16
0.6
1.00
0.4
0.2
0
-0.2
-0.4
min 1.16,-0.49
-0.6
1
1.2
1.4
1.6
1.8
case17
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase17 (x)dx = 0.483081
0.5
1.00
0.4
0.3
0.2
0.1
0
1
1.2
1.6
1.8
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase18 (x)dx = 0.527791
0.5
1.00
0.4
0.3
0.2
0.1
min 1.51, 0.00
0
1
1.2
1.4
1.6
1.8
10
case19
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase19 (x)dx = 0.564146
0.5
1.00
0.4
0.3
0.2
0.1
min 1.69, 0.03
0
1
1.2
1.4
1.6
1.8
case20
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase20 (x)dx = 0.502645
0.5
1.00
0.4
0.3
0.2
0.1
min 1.33, 0.02
0
1
1.2
1.4
1.6
1.8
11
1 1.04, 0.99
max
case21
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase21 (x)dx = 0.538807
0.5
1.00
0.4
0.3
0.2
0.1
min 1.51, 0.01
0
1
1.2
1.4
1.6
1.8
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase22 (x)dx = 0.429588
0.5
1.00
0.4
0.3
0.2
0.1
0
1
1.2
1.4
1.6
12
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase23 (x)dx = 0.486651
0.5
1.00
0.4
0.3
0.2
0.1
min 1.92, 0.02
0
1
1.2
1.4
1.6
1.8
case24
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase24 (x)dx = 0.502124
0.5
1.00
0.4
0.3
0.2
0.1
0 min 1.08, 0.00
1
1.2
1.4
1.6
1.8
13
1
max 1.80, case25
0.96
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase25 (x)dx = 0.497093
0.5
1.00
0.4
0.3
0.2
0.1
min 1.90, 0.02
0
1
1.2
1.4
1.6
1.8
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase26 (x)dx = 0.479911
0.5
1.00
0.4
0.3
0.2
0.1
0
1
1.2
1.4
1.8
14
1
max case27
1.86, 0.96
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase27 (x)dx = 0.576762
0.5
1.00
0.4
0.3
0.2
0.1
0 min 1.08, 0.00
1
1.2
1.4
1.6
1.8
case28
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase28 (x)dx = 0.494602
0.5
1.00
0.4
0.3
0.2
0.1
min 1.51, 0.02
0
1
1.2
1.4
1.6
1.8
15
case29
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase29 (x)dx = 0.486387
0.5
1.00
0.4
0.3
0.2
0.1
0
1
1.2
1.4
1.8
1
case30
max 1.86, 0.95
0.9
0.8
0.7
0.6
Calculated with trapezoidal rule:
Z 2.00
fcase30 (x)dx = 0.495551
0.5
1.00
0.4
0.3
0.2
0.1
min 1.78, 0.03
0
1
1.2
1.4
1.6
1.8
16
0.4
max 1.00, 0.39
case31
0.35
0.3
0.25
1.00
0.2
0.15
0.1
1
1.2
1.4
1.6
1.8
case32
0.35
0.3
Calculated with trapezoidal rule:
Z 2.00
fcase32 (x)dx = 0.248737
1.00
0.25
0.2
1.2
1.4
1.6
1.8
17
0.4
max 1.02, 0.39
case33
0.35
0.3
0.25
1.00
0.2
0.15
min 2.00, 0.14
0.1
1
1.2
1.4
1.6
1.8
0.4
case34
max 1.02, 0.38
0.35
0.3
Calculated with trapezoidal rule:
Z 2.00
fcase34 (x)dx = 0.251082
1.00
0.25
0.2
0.15
1
1.2
1.4
1.6
1.8
18
0.45
case35
max0.41.00, 0.40
0.35
0.3
0.25
0.2
0.15
0.1
1
1.2
1.4
1.6
1.8
0.45
case36
max0.41.00, 0.40
0.35
0.3
0.25
0.2
0.15
0.1
1
1.2
1.4
1.6
1.8
19
0.4
case37
0.35
0.3
0.25
1.00
0.2
0.15
min 2.00, 0.14
0.1
1
1.2
1.4
1.6
1.8
case38
0.35
0.3
Calculated with trapezoidal rule:
Z 2.00
fcase38 (x)dx = 0.253085
1.00
0.25
0.2
0.15
1
1.2
1.4
1.6
1.8
20
0.45
case39
max0.41.00, 0.40
0.35
0.3
0.25
0.2
0.15
0.1
1
1.2
1.4
1.6
1.8
0.4
case40
0.35
0.3
0.25
1.00
0.2
0.15
min 1.98, 0.14
0.1
1
1.2
1.4
1.6
1.8
21
0.4
max 1.04, 0.39
case41
0.35
0.3
0.25
1.00
0.2
0.15
0.1
1
1.2
1.4
1.6
1.8
0.4
max 1.02, 0.39
case42
0.35
0.3
Calculated with trapezoidal rule:
Z 2.00
fcase42 (x)dx = 0.254795
1.00
0.25
0.2
1.2
1.4
1.6
1.8
22
0.45
case43
max0.41.00, 0.40
0.35
0.3
0.25
0.2
0.15
min 1.98, 0.14
0.1
1
1.2
1.4
1.6
1.8
0.35
0.3
1.00
0.25
0.2
0.15
1
1.2
1.4
1.6
1.8
23
0.4
max 1.04, 0.40
case45
0.35
0.3
0.25
1.00
0.2
0.15
min 2.00, 0.14
0.1
1
1.2
1.4
1.6
1.8
max0.41.00, 0.40
case46
0.35
0.3
0.25
1.00
0.2
0.15
0.1
1
1.2
1.4
1.6
1.8
24
0.4
case47
max 1.08, 0.38
0.35
0.3
0.25
1.00
0.2
0.15
0.1
1
1.2
1.4
1.6
1.8
0.4
case48
max 1.02, 0.38
0.35
0.3
Calculated with trapezoidal rule:
Z 2.00
fcase48 (x)dx = 0.257156
1.00
0.25
0.2
0.15
1
1.2
1.4
1.6
1.8
25
0.45
case49
max
0.4 1.02, 0.40
0.35
0.3
0.25
0.2
0.15
min 1.98, 0.14
0.1
1
1.2
1.4
1.6
1.8
0.35
0.3
Calculated with trapezoidal rule:
Z 2.00
fcase50 (x)dx = 0.259834
1.00
0.25
0.2
0.15
1
1.2
1.4
1.6
1.8
26