source: trunk/Jgraph/ex2.jgr @ 418

Last change on this file since 418 was 418, checked in by Nicholas Riley, 12 years ago

Jgraph 8.3 from http://www.cs.utk.edu/~plank/plank/jgraph/jgraph.tar.gz

File size: 1.4 KB
Line 
1(* This is a graph for Figure 2 of the USENIX jgraph abstract.  It shows
2   how to extract points from a data file with awk, and how to use awk
3   to plot a function to match the data (the function that is plot here
4   is (n/k)log(n), where k is expermentally chosen to be 35000.
5
6   There are two graphs plotted -- the first is the actual jgraph.  The
7   second is a text string showing the input for the graph.  Print it
8   out -- you'll see what I mean.
9
10   *)
11
12newgraph
13xaxis size 2.5
14  hash_labels font Helvetica
15  label : Number of indexed Records (N)
16yaxis size 2.1
17  label : Running time (seconds)
18  hash_labels font Helvetica
19
20newcurve
21  marktype cross
22  label : Data
23  pts shell : awk '{print $5, $8}' data.txt
24
25newcurve
26  marktype none linetype solid
27  label : N log N / 35000
28   pts shell : nawk \
29     ' $5 != 0 { \
30       print $5,  $5 * log($5) / 35000}' \
31     data.txt
32
33copygraph
34x_translate -3.1
35border
36xaxis nodraw min 0 max 1 size 2.3
37yaxis nodraw min 0 max 1
38
39newstring hjl vjc x .03 y .5 font Courier fontsize 6 :
40xaxis size 2.5 \
41  hash_labels font Helvetica\
42  label : Number of indexed Records (N)\
43yaxis size 2.1 \
44  label : Running time (seconds)\
45  hash_labels font Helvetica\
46\
47newcurve \
48  marktype cross\
49  label : Data\
50  pts shell : awk '{print $5, $8}' data.txt\
51\
52newcurve\
53  marktype none linetype solid\
54  label : N log N / 35000\
55   pts shell : nawk \\
56     ' $5 != 0 { \\
57       print $5,  $5 * log($5) / 35000}' \\
58     data.txt\
Note: See TracBrowser for help on using the repository browser.