lib/matplotlib/text.py
def _get_textbox(text, renderer):
    """
    Calculate the bounding box of the text. Unlike
    :meth:`matplotlib.text.Text.get_extents` method, The bbox size of
    the text before the rotation is calculated.
    """

    projected_xs = []
    projected_ys = []

    theta = text.get_rotation()/180.*math.pi
    tr = mtransforms.Affine2D().rotate(-theta)

    for t, wh, x, y in text._get_layout(renderer)[1]:
        w, h = wh


        xt1, yt1 = tr.transform_point((x, y))
        xt2, yt2 = xt1+w, yt1+h

        projected_xs.extend([xt1, xt2])
        projected_ys.extend([yt1, yt2])


    xt_box, yt_box = min(projected_xs), min(projected_ys)
    w_box, h_box = max(projected_xs) - xt_box, max(projected_ys) - yt_box

    tr = mtransforms.Affine2D().rotate(theta)

    x_box, y_box = tr.transform_point((xt_box, yt_box))

    return x_box, y_box, w_box, h_box

    Calculate the bounding box of the text. Unlike
    :meth:`matplotlib.text.Text.get_extents` method, The bbox size of
    the text before the rotation is calculated.
    
Calculate the bounding box of the text. Unlike
Calculate the bounding box of the text . Unlike
def _get_textbox(text, renderer):
    projected_xs = []
    projected_ys = []
    theta = text.get_rotation()/180.*math.pi
    tr = mtransforms.Affine2D().rotate(-theta)
    for t, wh, x, y in text._get_layout(renderer)[1]:
        w, h = wh
        xt1, yt1 = tr.transform_point((x, y))
        xt2, yt2 = xt1+w, yt1+h
        projected_xs.extend([xt1, xt2])
        projected_ys.extend([yt1, yt2])
    xt_box, yt_box = min(projected_xs), min(projected_ys)
    w_box, h_box = max(projected_xs) - xt_box, max(projected_ys) - yt_box
    tr = mtransforms.Affine2D().rotate(theta)
    x_box, y_box = tr.transform_point((xt_box, yt_box))
    return x_box, y_box, w_box, h_box
def _get_textbox ( text , renderer ) : projected_xs = [ ] projected_ys = [ ] theta = text . get_rotation ( ) / 180. * math . pi tr = mtransforms . Affine2D ( ) . rotate ( - theta ) for t , wh , x , y in text . _get_layout ( renderer ) [ 1 ] : w , h = wh xt1 , yt1 = tr . transform_point ( ( x , y ) ) xt2 , yt2 = xt1 + w , yt1 + h projected_xs . extend ( [ xt1 , xt2 ] ) projected_ys . extend ( [ yt1 , yt2 ] ) xt_box , yt_box = min ( projected_xs ) , min ( projected_ys ) w_box , h_box = max ( projected_xs ) - xt_box , max ( projected_ys ) - yt_box tr = mtransforms . Affine2D ( ) . rotate ( theta ) x_box , y_box = tr . transform_point ( ( xt_box , yt_box ) ) return x_box , y_box , w_box , h_box
Calculate the bounding box of the text.
Calculate the bounding box of the text .
"""
    Calculate the bounding box of the text. Unlike
    :meth:`matplotlib.text.Text.get_extents` method, The bbox size of
    the text before the rotation is calculated.
    """
text
renderer
meth
`matplotlib.text.Text.get_extents` method, The bbox size of
the text before the rotation is calculated.
` matplotlib . text . Text . get_extents ` method The bbox size of the text before the rotation is calculated .