title: Cumulative histogram for 2D data in Python
body: <p>My data consists of a 2-D array of masses and distances. I want to produce a plot where the x-axis is distance and the y axis is the number of data elements with distance &lt;= x (i.e. a cumulative histogram plot). What is the most efficient way to do this with Python?</p>
  
  <p>PS: the masses are irrelevant since I already have filtered by mass, so all I am trying to produce is a plot using the distance data.</p>
  
  <p>Example plot below:</p>
  
  <p><a href="https://i.stack.imgur.com/wxwyv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wxwyv.png" alt="Example"></a></p>