Drawing a Histogram Plot

QUESTION: I see that I can set the PSYM=10 keyword on the PLOT command to draw a histogram plot. But, uh, it doesn't look exactly like the histogram plot I was expecting. Is there something else I should know? I tried this.

   IDL> data = RandomU(5L, 200)*20
   IDL> Plot, Histogram(data, BINSIZE=1.0), PSYM=10

And I got this result. I don't know. The ends are funny, and the data seems to be about half a bin out of align with the axis annotation. Can you help?

Normal histogram plot in IDL.
This a normal histogram plot in IDL.

ANSWER: Well, unfortunately, this is about as good as IDL can do out of the box. If you want something more, you have to write it. It's not difficult, but it has to be done.

I've written a short program that works for my purposes. It is called HISTOPLOT. You can use it like this.

   IDL> data = RandomU(5L, 200)*20
   IDL> !P.Multi = [0, 2, 2]
   IDL> Histoplot, data, BINSIZE=1.0
   IDL> Histoplot, data, BINSIZE=1.0, /FILL, POLYCOLOR=['charcoal', 'dodger blue']
   IDL> Histoplot, data, BINSIZE=1.0, /LINE_FILL, $
            POLYCOLOR=['charcoal', 'dodger blue'], ORIENTATION=[45, -45]
   IDL> Histoplot, data, BINSIZE=1.0, /FILL, POLYCOLOR='sky blue'
   IDL> moredata = RandomU(3L, 80)*20
   IDL> Histoplot, moredata, BINSIZE=1.0, /FILL, POLYCOLOR='royal blue', /OPLOT
   IDL> !P.MULTI = 0

Here is an example of what you see when you execute the commands above.

Using the HISTOPLOT plot command in IDL.
This is what can be done with the HISTOPLOT command from the Coyote Library.
 

Google
 
Web Coyote's Guide to IDL Programming