I not sure if I'm fully understanding your question, but if you want to generate a histogram with only two values, then using the WHERE function might be a possible. An example of how this can be done is shown below:
pro test_two_value_hist
compile_opt idl2
;create some random data and convert it
;byte data
raw_data = randomu(seed, 20,20)
byt_data = byte(raw_data*50)
;Determine the max value in the data
mx = max(byt_data,min=mn)
;Use where function to determine the
;number of times the max and min values
;occur in the data
wmx = where(byt_data eq mx, countmx)
wmn = where(byt_data eq mn, countmn)
;Generate a histogram with this information
b =barplot([mn,mx],[countmn,countmx], /histogram,$
fill_color='blue',yrange=[0,max([countmx,countmn])+2])
end
|