;+ ; Mark a verticle line at the given x-location. Optionally include a ; label at the same x and the given y-location. ; ; @param x {in}{required}{type=float} The x-location to draw the ; vertical line. In the current x-axis units. ; ; @keyword ylabel {in}{optional}{type=float} The y-location to put the ; optional label text. ylabel is required if label is specified. ; ; @keyword label {in}{optional}{type=string} The label to associate ; with this vertical line. ; ; @keyword noshow {in}{optional}{type=boolean} Don't immediately show ; the new vline. This is useful if you are stringing several ; vline calls together. It keeps the plotter from updating after each ; call and make the whole operation run faster. Simply call ; "show,/reshow" when you are ready to show the final result. ; ; @version $Id: vline.pro,v 1.3 2005/05/30 04:03:43 bgarwood Exp $ ;- pro vline, x, label=label, ylabel=ylabel, noshow=noshow, ynorm=ynorm compile_opt idl2 common gbtplot_common,mystate,xarray if n_elements(x) eq 0 then begin message,'Usage: vline, x[, label=label, ylabel=ylabel, /noshow, /ynorm',/info return endif if (keyword_set(label)) then begin if (not keyword_set(ylabel)) then begin message, 'ylabel is required when label is set',/info return endif endif else begin label = '' ylabel = 0.0 endelse mystate.nvlines = mystate.nvlines+1 mystate.vline_pos[mystate.nvlines-1,0] = x mystate.vline_pos[mystate.nvlines-1,1] = ylabel mystate.vline_txt[mystate.nvlines-1] = label mystate.vline_ynorm[mystate.nvlines-1] = keyword_set(ynorm) if not keyword_set(noshow) then show,/reshow end