title: Matlab - how does contour plot generating levels automatically?
body: <p>I am using contourf to generate filled contour plots on MatLab with specified levels number.</p>
  
  <p>According to the documents (<a href="https://www.mathworks.com/help/matlab/ref/contourf.html#mw_9088c636-4036-4e00-bd43-f6c5632b63ec" rel="nofollow noreferrer">https://www.mathworks.com/help/matlab/ref/contourf.html#mw_9088c636-4036-4e00-bd43-f6c5632b63ec</a>)
  It says <em>Specify levels as a scalar value n to display the contour lines at n automatically chosen levels (heights).</em> </p>
  
  <p>I am wondering how does it choose the threshold automatically? What is the algorithm of choosing the thresholds? Take level as 1 as an example.</p>
  
  <p>Many thanks!</p>