; This is a for loop which seems to be a cross between C and Fortran
; IMPORTANT: IDL is like C in that it the 1st element is numbered "0", so the loop must only go to JMAX-1
FOR j = 0,JMAX-1 DO BEGIN
EX = EX + DEX
; Here I have put in just a couple of print statements to assure myself that the program is working properly
; Note the syntax, like all in IDL, is a comma after the command, then the variable to be acted upon.
; Multiple variables can be strung together with commas, but they won't start a newline that way.
print, ' ' ; There may be a better way, but I forced a line skip by printing a string with nothing but a space in it
; Now we actually plot the arrays. In this case, XPis plotted
on the X axis, and Y1 is on the Y axis.
: Remember that the dollar sign is used to indicate this in one giant statement.
PLOT, XP, Y1, $
XTITLE = 'INCIDENT ENERGY (EV)', $ ; This is the x axis label
YTITLE = 'T TO V EFFICIENCY', $ ; This is the y axis label
PSYM = 0, $ ; PSYM is the plotting symbol. In this case, there it is a line with no individual points.
XSTYLE = 1, XRANGE = [0,8], $ ; The x axis is forced to the value specified in XRange
YSTYLE = 1, YRANGE = [0,1], $ ; The y axis is forced to the value specified in YRange
XTICKS = 4, XMINOR = 10, $ ; There are 4 units between the XRange 0-8, i.e. ending at 2,4,6,&8
YTICKS = 10, $ ; The Y axis does not have minor tick marks between the majors
CHARSIZE = 1 ; A character size of 1 is the default and does not need to be specified
OPLOT, XP, Y2
; This command overlays another plotted line
over the first one
OPLOT, XP, Y3
OPLOT, XP, Y4
OPLOT, XP, Y5
; I have removed the print command from this program to keep it simple. Look at the other examples of how to print