;+ ; NAME: ; plotbars_boundary ; PURPOSE: ; (Internal use by plotbars only) ; CATEGORY: ; ucsd/gen/idl/toolbox/graphics ; CALLING SEQUENCE: FUNCTION plotbars_boundary, j, jfirst, jlast, fpnt, negative_side, positive_side, low_margin, $ nojoin = nojoin , $ bad_sequence = bad_sequence , $ cdf = cdf ; INPUTS: ; j ; jfirst ; jlast ; fpnt ; hegative_side ; positive_side ; low_margin ; OPTIONAL INPUT PARAMETERS: ; /nojoin ; /bad_sequence ; OUTPUTS: ; rr[2,n] ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar ; PROCEDURE: ; MODIFICATION HISTORY: ; MAY-2012, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, nojoin , /key InitVar, bad_sequence, /key InitVAr, cdf , /key p = [negative_side[j]*[1,1],positive_side[j]*[1,1]] npnt = n_elements(fpnt) low_on_negative_side = low_margin IF j EQ npnt-1 AND cdf THEN low_on_positive_side = fpnt[npnt-1] ELSE low_on_positive_side = low_margin IF bad_sequence THEN BEGIN ; For the first and last points in a bad sequence, ; make sure not to overplot the boundary shared ; with the adjacent sequence of good points. IF j EQ jfirst AND j NE 0 THEN IF finite(fpnt[j-1]) THEN low_on_negative_side = min(fpnt[[j,j-1]]) IF j EQ jlast AND j NE n_elements(fpnt)-1 THEN IF finite(fpnt[j+1]) THEN low_on_positive_side = min(fpnt[[j,j+1]]) ENDIF IF nojoin THEN BEGIN ; If common part of sides between adjacent bars is not be drawn IF j NE jfirst THEN IF finite(fpnt[j-1]) THEN low_on_negative_side = min(fpnt[[j,j-1]]) IF j NE jlast THEN IF finite(fpnt[j+1]) THEN low_on_positive_side = min(fpnt[[j,j+1]]) ENDIF q = [low_on_negative_side,fpnt[j],fpnt[j],low_on_positive_side] RETURN, transpose( [[p],[q]] ) & END