Write histogram