| Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
| Version 1.9 Build 803 |
|
Chapter 12 of the Glish User Manual describes using direct PGPLOT bindings with Glish. A PGplotter tool is not required to use those direct bindings. However, PGplotter tools do support those methods. The only difference being that events described in the Reference Manual are replaced by functions when using the PGplotter. In practice this amounts to the '->' being replaced by '.'. For example, to set the color index use pg.sci(3) rather than pg->sci(3). The following example shows a simple plot drawn with the primitive PGPLOT commands.
include 'pgplotter.g'
#
tmp := -100:100
x:=tmp/10
y:=sin(x)*exp(x/5)
#
pg:=pgplotter()
pg.env(-10,10,-7,7,1,0)
pg.lab('X Axis','Y Axis','A Clever Plot')
pg.sci(3)
pg.line(x,y)
pg.sci(2)
pg.ptxt(-8,5,0,0,'Runaway sinusoid')
pg.arro(-6,4.5,0,1)
Consult the Glish User Manual for the comprehensive list of PGPLOT routines available.