def tile(self, ncols, nrows):
dx = (self.width/ncols).to('<STR_LIT>').value<EOL>dy = (self.height/nrows).to('<STR_LIT>').value<EOL>ix, iy = <NUM_LIT:0>, <NUM_LIT:0><EOL>for el in self:<EOL><INDENT>el.move(dx*ix, dy*iy)<EOL>ix += <NUM_LIT:1><EOL>if ix >= ncols:<EOL><INDENT>ix = <NUM_LIT:0><EOL>iy += <NUM_LIT:1><EOL><DEDENT>if iy > nrows:<EOL><INDENT>break<EOL><DEDENT><DEDENT>return self<EOL>
Automatically tile the panels of the figure.

        This will re-arranged all elements of the figure (first in the
        hierarchy) so that they will uniformly cover the figure area.

        Parameters
        ----------
        ncols, nrows : type
            The number of columns and rows to arange the elements into.


        Notes
        -----
        ncols * nrows must be larger or equal to number of
        elements, otherwise some elements will go outside the figure borders.