;+
; NAME:
; oplot_vertical
;
;
; PURPOSE:
; oplt a vertical ine on a plot at a given x-value
;
;
; INPUTS:
; xval: the value where the line is to be drawn.
;
;
; KEYWORD PARAMETERS:
; _EXTRA: keywords to oplot
; LOG: plot the line on a log scale
; PLOTS: allows plotting across an arbitary range on plot (outside of
; axes if wanted)
;
; OUTPUTS:
; a vertical line on the current plot
;
;
;
; EXAMPLE:
; plot, findgen(11)
; oplot_vertical, 3, linestyle=2
;
;
; MODIFICATION HISTORY:
;
; Fri Dec 19 14:31:12 2008, Brian Larsen
; added maxval and minval functionality
;
; Fri Feb 8 14:20:18 2008, Brian Larsen
; fixed an error with the log functionality
;
; Thu Jan 17 14:35:08 2008, Brian Larsen
; added log keyword to work on log plots
;
; Thu Nov 29 14:24:43 2007, Brian Larsen
; changed to use scale_vector and allows for array input
;
; Tue Oct 16 17:50:02 2007, Brian Larsen
; documented, written previously
;
;-
PRO oplot_vertical, xval, $
LOG=log, $
MAXVAL = maxval, $
MINVAL = minval, $
PLOTS = PLOTS, $ ; allows plotting across an arbitary range on plot outside of axes
_EXTRA=_extra
SetDefaultValue, maxval, max(!y.crange)
SetDefaultValue, minval, min(!y.crange)
y = scale_vector(dindgen(100), minval, maxval)
IF keyword_set(log) THEN y = 10.^y
x = dblarr(N_ELEMENTS(y))
FOR i=0l, n_elements(xval)-1 DO BEGIN
x[*] = xval[i]
IF keyword_set(plots) THEN $
plots, x, y, /data, _STRICT_EXTRA=_extra ELSE $
oplot, x, y, _STRICT_EXTRA=_extra
ENDFOR
END