File: scripts

package info (click to toggle)
ploticus-doc 2.33-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,392 kB
  • ctags: 169
  • sloc: pascal: 469; makefile: 63; sh: 11
file content (230 lines) | stat: -rw-r--r-- 5,286 bytes parent folder | download
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>ploticus: introduction to ploticus scripts</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550><tr>
<td>
  <table cellpadding=2 width=550><tr>
  <td><br><h2>Introduction to ploticus scripts</h2></td>
  <td align=right>
  <small>
  <a href="../doc/welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
  Version 2.33 Jun'06
     </small><br><a href="../doc/scripthome.html">Scripts</a>
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH Introduction_to_ploticus_scripts PL "02-JUN-2006   PL ploticus.sourceforge.net"

.LP
Ploticus is controlled by scripts that a 
user creates in a text editor and saves in a file.
Script files should be plain ascii text files, and they
may be named anything, however a file name ending of
\fB.p\fR, \fB.pl\fR, \fB.plo\fR, or \fB.pls\fR
is recommended.

.LP
Note that for many uses you don't need to write a script at all.. you can use a
.ig >>
<a href="prefabs.html">
.>>
\0ploticus prefab,
.ig >>
</a>
.>>
and control the plot by supplying some parameters on the command line 
while everything else is handled automatically.  Scripts are useful when
customization is needed, or for doing more sophisticated operations like multiple
plots, overlays, data manipulation and processing, or for graph types where
a prefab doesn't exist.


.ig >>
<br><br><br>
.>>

.SH Simple example
.nf
.ft C
.ig >>
<br><img src="../gallery/simple1.gif"><br>
.>>
\0
\0// simple example 1
\0
\0#proc areadef
\0  rectangle: 1 1 4 2
\0  xrange: 0 5
\0  yrange: 0 100
\0
\0#proc xaxis:
\0  stubs: text
\0	Africa
\0	Americas
\0	Asia
\0	Europe,\\nAustralia,\\n\& Pacific
\0
\0#proc yaxis
\0  label: Growth Rate
\0  stubs: inc 20
\0  minortics: yes
\0  minorticinc: 5
\0
\0#proc getdata
\0  data: 76 
\0	54 
\0	60 
\0	59
\0
\0#proc bars
\0  lenfield: 1
\0  color: teal
\0  barwidth: 0.2
\0
.ft R
.fi

.LP
As you can see, this is not low-level 3GL-style code.  It is a sort of
hybrid; plotting actions (#procs) are specified in procedural order,
but within each #proc the language is goal-driven (4GL).  Thus, traditional
procedural programming skills are not required.
.LP
The above ploticus script invokes a number of procedures (procs).
First,
\fBproc areadef\fR to set up a plotting area, then
\fBproc xaxis\fR and \fByaxis\fR to render the axes.
Then \fBproc getdata\fR is invoked to define some data, 
and then finally \fBproc bars\fR is invoked to produce a bar graph.
.LP
For each proc, the user may specify a various attributes or options.
Attributes that are not specified use a default when possible.
In the above example, the user has invoked \fCproc areadef\fR
and specified values for these attributes: \fCrectangle\fR, \fCxrange\fR,
and \fCyrange\fR.  
All of the procs, as well as the names, types, and acceptable 
values for all attributes, are described in the 
.ig >>
<a href="../doc/scripthome.html">
.>>
\0ploticus scripts handbook.
.ig >>
</a>
.>>

.ig >>
<br><br><br>
.>>

.SH Another example
.ig >>
<br><img src="../gallery/simple2.gif"><br>
.>>
A typical use of ploticus is to display chronological data.
Suppose we have some data in a file called \fClog.dat\fR that has
fields \fCcount\fR and \fCdt\fR like this:
.nf
  18 071301
  16 071401
  15 071501
  34 071601
  ...etc..
.fi
Here's a script that will automatically scale to the data and plot the values 
over time as shown above:
.nf
\0
\0// simple example 2
\0
\0#proc getdata
\0file: ../pltestsuite/data19
\0fieldnames: count dt
\0
\0#proc areadef
\0rectangle: 1 1 5 3
\0xscaletype: date mmddyy
\0xautorange: datafield=dt
\0yautorange: datafield=count incmult=2.0 lowfix=0
\0xaxis.stubs: inc 1 month
\0xaxis.stubformat: Mmmyy
\0yaxis.stubs: inc
\0
\0#proc lineplot
\0xfield: dt
\0yfield: count
\0linedetails: color=red
\0
.fi

.ig >>
<br><br>
.>>

.LP
A large collection of script examples may be found in the
.ig >>
<a href="../gallery/index.html">
.>>
\0ploticus scripts gallery.
.ig >>
</a>
.>>
One way to proceed is to locate an example that is similar to what you
want, and then copy it and play with it.

.LP
.ig >>
<br><br><br>
.>>
.ig >>
<a href="scriptsyntax.html">
.>>
\0Continue to Script Syntax page
.ig >>
</a>
.>>

.LP

.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="../doc/welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine &nbsp; <br>
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif"> 
</center>
</td></tr>
</table>
<br>
<center>
Ploticus is hosted at http://ploticus.sourceforge.net <br>
<img src="http://sourceforge.net/sflogo.php?group_id=38453" width="88" height="31" border="0" alt="SourceForge Logo">
</center>
.>>