Hello all. I have a paper that gives the number of binary stars as a function of period. The period is given in a log scale. I want to create at random a list of binary stars, with their period coming from this distribution. The problem is, I am not sure quite how to do this properly with a log distribution. What I currently do is choose at random, based on the cumulative probability, one of the edges of the histogram. I then the actual period is calculated from a uniform random distribution between this edge and the next edge to the left. I always figured this would be an approximation, but it is really scewing the distribution I draw. Can someone please give me some advice? I have attached images of the distribution taken from the paper, a Matlab plot of it (so basically the same thing) and then a histogram of the distribution I draw, which you can see is skewed. Note that the data was taken off the histogram by eye.

Thank you in advance!