histo plotting code