12.07.2015 Views

GLE User Manual - Fedora Project Packages GIT repositories

GLE User Manual - Fedora Project Packages GIT repositories

GLE User Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

48 CHAPTER 6. PROGRAMMING FACILITIESeng 3 append geng 3 10 numeng 3 appendsci 0 10 expdigits 2 expsignpifracfix 20.00 g 500 g 1.00 kg 1.50 kg 2.00 kg1.00 10 -6 100 10 -6 10.0 10 -3 1.00 10 0 100 10 0 10.0 10 3 1.00 10 61.00 100 10.0 m 1.00 100 10.0 k 1.00 M10 -06 10 -04 10 -02 10 +00 10 +02 10 +04 10 +060 /2 3 /2 2-1 -3/4 -1/2 -1/4 0 1/4 1/2 3/4 1-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00Figure 6.1: Examples of number formatting options.gle -o beans.eps graph.gle "Beans" "beans.csv"gle -o peas.eps graph.gle "Peas" "peas.csv"This will create two graphs: “beans.eps” and “peas.eps”. The arg() functions can be used at allplaces in the script where an expression is expected. They can even be used in place of <strong>GLE</strong>commands in a graph block by means of the \expr() function. For example,data "file.csv"d\expr{arg(1)} line color redin the graph block will allow one to draw different datasets from a single file on multiple graphs.To do so, run:gle -o d1.eps graph.gle 1gle -o d2.eps graph.gle 2dataxvalue(ds,i), datayvalue(ds,i), ndata(ds)These functions can be used to retrieve the data values from a given dataset. They only work afterdata has been loaded by means of a graph block (Ch. 4).A dataset is specified with a dataset identifier ds (a string of the form “di”, with i an integer).The function ‘ndata’ returns the number of points in the dataset, and the functions ‘dataxvalue’ and‘datayvalue’ return the x and y values of point i, where i ranges from 1 to ndata(ds).The following example shows how these functions can be used to compute the maximum of a dataset:sub dmaxy ds$local crmax = datayvalue(ds$,1)for i = 2 to ndata(ds$)crmax = max(crmax, datayvalue(ds$,i))next ireturn crmaxend subThis subroutine together with other subroutines for computing the minimum, mean, area, etc. ofa dataset are defined in the include file ‘graphutil.gle’, which is distributed together with <strong>GLE</strong>.format$(exp,format)Returns a string representation of exp formatted as specified in format.Basic formats:• append s: appends the string s after the formatted number. This can be used to add a unit.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!