*** Open up a graphics file fort/fil 66 rsum.ps * * try help meta to see what this means * meta 66 -111 * * put everything to default * set 0 * * Some commands to make the plots look nice * I liked this setup so I just keep it around * set pass 3 igset pass 3 set cfon 130 | Comment Font and Precision(ID#, Entries,,)(02) set tfon 130 | Text and Title Font and Precision(02) set tsiz 0.40 | histogram title SIZe in cm(0.28) set vfon 130 | axis Values Font and Precision(02) set vsiz 0.30 | axis Values SIZe in cm(0.28) set lfon 130 | set txfp 130 opt nsta opt nbox opt utit * title for our graphic page title 'Summing Uniformly Distributed (0-1) Random Numbers' * we want a page to have 2 histos in x and 2 in y zone 2 2 * creating data vectors vec/cre v2(1000) vec/cre v1(1000) * to do operations on vectors, you have to type the word 'sigma' first sigma v1=rndm(v2) * plot this bad boy up vec/pl v1 * give the axes names atitle 'One Random Number' 'Number of trials' sigma v1=rndm(v2)+v1 vec/pl v1 atitle 'Sum of Two Random Numbers' 'Number of trials' sigma v1=rndm(v2)+v1 vec/pl v1 atitle 'Sum of Three Random Numbers' 'Number of trials' sigma v1=rndm(v2)+v1 vec/pl v1 atitle 'Sum of Four Random Numbers' 'Number of trials' * close our graphics file close 66 * this just stops execution until I hit return read i zone fort/fil 66 rsum2.ps meta 66 -111 title 'Summing Uniformly Distributed (0-1) Random Numbers' hi/pl 12345 fun/pl (24)*exp(-0.5*3*(x-2.0)**2) 0 4 s atitle 'Sum of Four Random Numbers' 'Number of trials' text 0.5 33 'Overlay of a Gaussian with mean 2 and Sigma of 0.577' .35 close 66 * * ok lets jazz this up a bit * set hcol 4 set fcol 3 read i set htyp 2 set ftyp 2 set txci 6 vec/pl v1 read i fun/pl (24)*exp(-0.5*3*(x-2.0)**2) 0 4 s read i atitle 'Sum of Four Random Numbers' 'Number of trials' set txci 7 text 0.5 33 'Overlay of a Gaussian with mean 2 and Sigma of 0.577' .35