;+ ; NAME: ; oplot_horiz ; ; ; PURPOSE: ; oplot a horizontal line on the current plot ; ; ; CATEGORY: ; plotting ; ; ; INPUTS: ; yval: the yval where the lineis to be drawn ; ; ; KEYWORD PARAMETERS: ; _EXTRA: keywords to oplot ; LOG: plot on a log axis ; ; ; OUTPUTS: ; horiz line on current plot ; ; ; EXAMPLE: ; plot, findgen(11) ; oplot_horiz, 3, linestyle=2 ; ; MODIFICATION HISTORY: ; ; Fri Feb 8 14:08:53 2008, Brian Larsen ; ; fixed an error with log functionality ; ; Thu Jan 17 14:36:42 2008, Brian Larsen ; ; added log keyword ; ; Thu Nov 29 15:36:56 2007, Brian Larsen ; ; changed to use scale_vector and allowed for array input ; ; Tue Oct 16 17:52:26 2007, Brian Larsen ; ; documented, written previously ; ;- PRO oplot_horiz, yval, LOG=log, _EXTRA=extra x = scale_vector(lindgen(2), min(!x.crange), max(!x.crange)) IF keyword_set(log) THEN x = 10.^x y = dblarr(N_ELEMENTS(x)) FOR i=0l, n_elements(yval)-1 DO BEGIN y[*] = yval[i] oplot, x, y, $ _STRICT_EXTRA=extra ENDFOR END
Disclaimer