in reply to Sampling From a Histogram Distribution

Maybe this solution which I think is similar to what you're seeking - from Stackoverflow.
  • Comment on Re: Sampling From a Histogram Distribution