title: Determine subplot square dimensions from total number of plots
body: <p>I'm trying to figure out how to calculate subplot dimensions when I know the total number of plots I need and I'd like the arrangement to be a square (with possibly a few empty subplots). </p>
  
  <p>For example if I need 22 subplots then I would make a grid of <code>5x5</code> for a total of 25 subplots, then just leave three of them empty.</p>
  
  <p>So I guess I'm looking for an algorithm where I'd input 22 and get out 5, for example. Anyone know of a short way to do this in python (maybe lambda function if possible)? </p>
  
  <p>(Also open to other alternatives or pre-made solutions for doing this, I'm doing multiple subplot matrices for a dictionary of pandas dataframes)</p>