The best way to produce good plots is to set up a QCL command file
to do the job. Here follow some examples of simple command files which
produce pretty plots and demonstrate the use of the GRP package.
- Plotting of data from formatted files.
!./grptest.qcl Procedure to plot M1 reflectivities
!Select plotting device
GRP_PDEV=QCL_CL(1,'graphics device','xw')
OPEN
ZONE 0.0,1.0,0.0,1.0
!Define labels
GRP_LABX='Energy eV'
GRP_LABY='g M1'
GRP_TITLE='Measured reflectivities ROSAT WFC M1'
!Set mapping
AMAPXYL 10.0,1000.0,1.0E-3,1.0
!Draw axes and labels
AXES
!Plot Henke theory
XYFMT 'm1henke.dat',6,0,3,0,1,1000
!Solid line curve
XY_CUR 0
!Plot Hagemann theory
XYFMT 'm1hagemann.dat'
!Dotted line curve
XY_CUR 4369
!Plot measurements
XYFMT 'm1ref.dat',5,6,3,4,2,20
!Error bars
XY_BAR
!Plot measurements with circles as well (polymarker index 4)
XY_SYM 4,1
!Include legend for theoretical curves
POS 12.0,1.0E-2
JOIN 25.0,1.0E-2,4369
TEXT 'Hagemann et al',30.0,1.0E-2,0
POS 12.0,5.0E-3
JOIN 25.0,5.0E-3,0
TEXT 'Cromer and Liberman',30.0,5.0E-3,0
!Turn device off
CLOSE
- Use of the interactive cursor to get times from a light curve
(also illustrating use of XYHXS).
!./grptest5.qcl Get times from TIME file with cursor
!Select plotting device
GRP_PDEV=QCL_CL(1,'graphics device','xw')
OPEN
!Get data file
HDS_NODE=QCL_CL(2,'file name',' ')
!Get light curve data (fixed : PHA chan=1, ID chans 1-4 specified)
XYHXS 'TIME',1,1,4
!Get time limits from user
. 'Time limits in light curve ',//GRP_XLEFT//' to '//GRP_XRIGHT
. 'Specify limits for plot'
GRP_XLEFT=QCL_CL(3,'Start time',GRP_XLEFT)
GRP_XRIGHT=QCL_CL(4,'Stop time',GRP_XRIGHT)
!Set up mapping
AMAP
!Plot light curve
XYAHIS 0
!Now loop to get times with cursor
ITIM=0
. 'Set cursor to time required, RED button to stop'
.BEGIN
CUR
.IF GRP_NCHOI.GT.0
ITIM=ITIM+1
SAVEPOS ITIM
.ENDIF
.UNTIL GRP_NCHOI.EQ.0
. INT(ITIM)//' times saved in array GRP_XPSAV()'
.DO I=1,ITIM
. INT(I)//' '//GRP_XPSAV(I)
.LOOP
!Turn device off
CLOSE
- Plotting data from a HDS file (could use XYHXS!).
!Test QCL procedure to plot light curve from a HDS file
!Set node to test file
HDS_NODE='n500.sdf'
!Get inline parameters GRP_PDEV,ICHAN
GRP_PDEV=QCL_CL(1,'graphics device','xw')
ICHAN=QCL_CL(2,'Channel to be plotted',1)
OPEN GRP_PDEV
!Set up slice to pick out requested channel
NELS=HDE_NELS(1)
NLO=(ICHAN-1)*NELS+1
NHI=NLO+NELS-1
SLICE='('//INT(NLO)//':'//INT(NHI)//')'
!Assign data and variance names
YDAT='DATA_ARRAY'//SLICE
YERR='VARIANCE'//SLICE
!Get data into buffers
XYHDS 1,'TSTART','TDELTA',3,YDAT,YERR
!Change labelling and title
GRP_LABX=HDE_DIM_UNIT(1)
GRP_LABY=HDE_DATA_UNIT
!Do plot and close device
XYAHIS 0
CLOSE
[Next: Command Summary]
[Previous: Annotation of Sky Images]
[Back to Contents]