def shrunk_to_aspect(self, box_aspect, container = None, fig_aspect = <NUM_LIT:1.0>):
assert box_aspect > <NUM_LIT:0> and fig_aspect > <NUM_LIT:0><EOL>if container is None:<EOL><INDENT>container = self<EOL><DEDENT>w, h = container.size<EOL>H = w * box_aspect/fig_aspect<EOL>if H <= h:<EOL><INDENT>W = w<EOL><DEDENT>else:<EOL><INDENT>W = h * fig_aspect/box_aspect<EOL>H = h<EOL><DEDENT>return Bbox([self._points[<NUM_LIT:0>],<EOL>self._points[<NUM_LIT:0>] + (W, H)])<EOL>
Return a copy of the :class:`Bbox`, shrunk so that it is as
large as it can be while having the desired aspect ratio,
*box_aspect*.  If the box coordinates are relative---that
is, fractions of a larger box such as a figure---then the
physical aspect ratio of that figure is specified with
*fig_aspect*, so that *box_aspect* can also be given as a
ratio of the absolute dimensions, not the relative dimensions.