Sorted histogram