def get_ticklabel_extents(self, renderer):
ticklabelBoxes = []<EOL>ticklabelBoxes2 = []<EOL>interval = self.get_view_interval()<EOL>for tick, loc, label in self.iter_ticks():<EOL><INDENT>if tick is None: continue<EOL>if not mtransforms.interval_contains(interval, loc): continue<EOL>tick.update_position(loc)<EOL>tick.set_label1(label)<EOL>tick.set_label2(label)<EOL>if tick.label1On and tick.label1.get_visible():<EOL><INDENT>extent = tick.label1.get_window_extent(renderer)<EOL>ticklabelBoxes.append(extent)<EOL><DEDENT>if tick.label2On and tick.label2.get_visible():<EOL><INDENT>extent = tick.label2.get_window_extent(renderer)<EOL>ticklabelBoxes2.append(extent)<EOL><DEDENT><DEDENT>if len(ticklabelBoxes):<EOL><INDENT>bbox = mtransforms.Bbox.union(ticklabelBoxes)<EOL><DEDENT>else:<EOL><INDENT>bbox = mtransforms.Bbox.from_extents(<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>)<EOL><DEDENT>if len(ticklabelBoxes2):<EOL><INDENT>bbox2 = mtransforms.Bbox.union(ticklabelBoxes2)<EOL><DEDENT>else:<EOL><INDENT>bbox2 = mtransforms.Bbox.from_extents(<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>)<EOL><DEDENT>return bbox, bbox2<EOL>
Get the extents of the tick labels on either side
of the axes.