made histogram plotting function for counters