; To run IDL type idlde at a terminal command line. You will have access to ; all of the files in the directory from which IDL is run. To call this program ; compile it and then type idlEXjww, {some number} ; IDL is ; A high level programing language ; A library with lots of built in functions ; Fun ; Example program by J.W. Wellhouse pro idlEXjww, T ; A Procedure this is. ;make some fake data print, randomu(seeds,/DOUBLE) ; setup vars x = dblarr(101) y = dblarr(101) err = dblarr(101) ; make up some data for i = 0,100 do begin x[i] = 2*i y[i] = 2^(20*(randomu(seeds)-0.5)) err[i] = 0.3*(randomu(seeds)+1)*y[i] endfor ; setup the ps file psoutname = 'ItsAPlot.ps' !p.font=0 set_plot, 'ps' device, xoffset=0.0, yoffset=0.0, xsize=8.0, ysize=9.0, /inches, $ /portrait, filename=psoutname, encapsulated=0, /color device, /times, isolatin1=1, font_size=14 ; setup colour loadct, 0 ; first plot ; multi plot !P.MULTI = [0, 1, 2, 0, 0] ; Make the box maxholderx = max(x, MIN=minholderx) maxholdery = max(y, MIN=minholdery) PLOT,x,y, XRANGE = [minholderx, maxholderx], YRANGE = [minholdery, maxholdery], TITLE='FirstPlot', $ XTITLE='X', YTITLE='Y', color=0, /YLOG, PSYM = 3 ; Add the data ; New Colour for the plot loadct, 10 OPLOT, x, y, COLOR = 196, PSYM = 4 ; error bars OPLOTERR, x, y, err, 3 ; second plot !P.MULTI = [1, 1, 2, 0, 0] PLOT,x,err, TITLE='SecondPlot', XTITLE='X', YTITLE='Errorss', color=0, PSYM=-3, YRANGE=[-50,600], YSTYLE=1 OPLOT, x, err, COLOR = 115, PSYM = 4 ; If you do not like the PSYM options look at USERSYM ; add some text XYOUTS, 50, 400, '!LLower!S!EExponent!R!IIndex!N Normal!S!EExp!R!IInd!N!S!U Up!R!DDown!N!S!A Above!R!B Below', $ COLOR = 238 ; Draw An Arrow ARROW, 150, 500, 175, 300, /DATA;, COLOR=40 ; close ps file device, /close ; be nice to the next program !P.MULTI = 0 !P.PSYM = 0 ; Demo some things PRINT, T, ' Was fed in' print, 'pi = ', !DPI print, ABS(ALOG10(randomu(seeds))) PRINT, JULDAY(10,4,1582), JULDAY(10,5,1582), JULDAY(10,15,1582) PRINT, JULDAY(10,5,2007,14,29,32), ' The Accuracy is too low for astronomy use I think' ; Complex fun A = [1,2,3] B = INDGEN(3) B[0] = 4 B[1] = 5 B[2] = 6 C = COMPLEX(A, B) PRINT, C PRINT, 'Real Part: ', REAL_PART(C) PRINT, 'Imaginary Part: ', IMAGINARY(C) PRINT, 'Abs: ', ABS(C) ; Strange Things PRINT, 'Kurtosis: ', KURTOSIS(y) PRINT, 'Spline: ', SPLINE(x,y,20) print, "Done" ;exit end