| Server IP : 35.80.110.71 / Your IP : 216.73.216.52 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/matplotlib/__pycache__/ |
Upload File : |
�
G8�c� � �v � d Z ddlZddlZddlZddlmZ ddlZddlZddl Z
ddlmZm
Z
mZmZ ddl
mZ ddlmZ ddlmZmZmZ dd lmZ dd
lmZmZmZmZmZmZ ej@ e!� Z" ejF d� d� � Z$d
� Z%d� Z& ejN d� d� � Z(ejR ejT dgdgddgdgdgdgdgdgdgdgdgdgd�� G d� d e� � � Z+ G d!� d"� Z, G d#� d$� Z- G d%� d&e+e-� Z.ejR j_ e.j` j �'� y)(z)
Classes for including text in a figure.
� N)�Real� )�_api�artist�cbook�
_docstring)�Artist)�FontProperties)�FancyArrowPatch�FancyBboxPatch� Rectangle)�TextPath)�Affine2D�Bbox�BboxBase�BboxTransformTo�IdentityTransform� Transform�3.6c �� � t | � dz S # t t f$ rX}t j | d� s| �Y d}~yt j | d� rY d}~yt dj | � � |�d}~ww xY w)a*
Return *rotation* normalized to an angle between 0 and 360 degrees.
Parameters
----------
rotation : float or {None, 'horizontal', 'vertical'}
Rotation angle in degrees. *None* and 'horizontal' equal 0,
'vertical' equals 90.
Returns
-------
float
�h �
horizontalN� �vertical� �V@zRrotation is {!r}; expected either 'horizontal', 'vertical', numeric value, or None)�float�
ValueError� TypeErrorr �
_str_equal�format)�rotation�errs �1/usr/lib/python3/dist-packages/matplotlib/text.py�get_rotationr$ sv � �
9��X���$�$��� �"� 9����H�l�3�x�7G��
�
�
�h�
�
3��� B�$�f�X�.�0�58�
9��
9�s �
�A7�A2�A2�A2�2A7c �0 � g }g }t j | j � � }t � j | � }| j |� \ }}}|D ]W \ } }
}}|
\ }
}|j
||f� \ }}||z }||
z ||z }}|j ||g� |j ||g� �Y t |� t |� }}t |� |z
t |� |z
}}t � j |� j
||f� \ }}||||fS )z�
Calculate the bounding box of the text.
The bbox position takes text rotation into account, but the width and
height are those of the unrotated box (unlike `.Text.get_window_extent`).
)
�np�deg2radr$ r �rotate�_get_layout� transform�extend�min�max)�text�renderer�projected_xs�projected_ys�theta�tr�_�parts�d�t�wh�x�y�w�h�xt1�yt1�xt2�yt2�xt_box�yt_box�w_box�h_box�x_box�y_boxs r# �_get_textboxrG 6 s* � � �L��L��J�J�t�(�(�*�+�E� �� � �E�6� "�B��"�"�8�,�K�A�u�a�� (���2�q�!����1��<�<��A��'���S��q�����7�C�!�G�S�����S�#�J�'����S�#�J�'�(� ��&��L�(9�F�F��|�$�v�-�s�<�/@�6�/I�5�E��:�$�$�U�+�5�5�v�v�6F�G�L�E�5��%���%�%� c �b � t t j | � ||j � ||� S )zECall ``renderer.get_text_width_height_descent``, caching the results.)�!_get_text_metrics_with_cache_impl�weakref�ref�copy)r/ r. �fontprop�ismath�dpis r# �_get_text_metrics_with_cacherQ ] s- � � -����H��t�X�]�]�_�f�c�C� CrH i c �2 � | � j |||� S �N)�get_text_width_height_descent)�renderer_refr. rN rO rP s r# rJ rJ e s � � �>�7�7��h��O�OrH �c�family�font�font_properties�ha�ma�name�size�stretch�style�variant�va�weight)�color�
fontfamily�fontproperties�horizontalalignment�multialignment�fontname�fontsize�fontstretch� fontstyle�fontvariant�verticalalignment�
fontweightc �x � � e Zd ZdZdZd� Z ej dd�� dOdd�� fd �� Z� fd
�Z � fd�Z
d� Zd
� Zd� Z
d� Zd� Zd� Zd� Z� fd�Zd� Zd� Zd� Zd� Zd� Z� fd�ZdP� fd� Z� fd�Zd� Zd� Zd� Zd� Zd � Zd!� Z e!jD d"� � Z#d#� Z$d$� Z%d%� Z&d&� Z'd'� Z(d(� Z)d)� Z*d*� Z+d+� Z,d,� Z-d-� Z.d.� Z/ ej` d/� dPd0�� Z1d1� Z2d2� Z3dQd3�Z4d4� Z5d5� Z6d6� Z7d7� Z8d8� Z9d9� Z:d:� Z;d;� Z<d<� Z=d=� Z>d>� Z?d?� Z@d@� ZAdA� ZBdB� ZCdC� ZDdD� ZEdE� ZFdF� ZGdG� ZHdH� ZIdI� ZJdJ� ZKdK� ZLdL� ZMdM� ZNdN� ZO� xZPS )R�TextzAHandle storing and drawing of text in window or data coordinates.� c �h � d| j �d| j �dt | j � �d�S )NzText(z, �))�_x�_y�repr�_text��selfs r# �__repr__z
Text.__repr__� s � �%)�W�W�d�g�g�t�D�J�J�7G�H�HrH r rc )r\ N)�
parse_mathc �z �� t �| � � ||c| _ | _ d| _ | j |� | j
|�|nt j d � | j |� | j |� | j |�|nt j d � | j |
� | j |� | j |� || _ | j! | � || _ d| _ d| _ |
�d}
| j) |
� | j+ |� | j- |� y)a
Create a `.Text` instance at *x*, *y* with string *text*.
The text is aligned relative to the anchor point (*x*, *y*) according
to ``horizontalalignment`` (default: 'left') and ``verticalalignment``
(default: 'bottom'). See also
:doc:`/gallery/text_labels_and_annotations/text_alignment`.
While Text accepts the 'label' keyword argument, by default it is not
added to the handles of a legend.
Valid keyword arguments are:
%(Text:kwdoc)s
� Nz
text.colorztext.parse_mathg333333�?)�super�__init__rt ru rw �set_text� set_color�mpl�rcParams�set_fontproperties�
set_usetex�set_parse_math�set_wrap�set_verticalalignment�set_horizontalalignment�_multialignment�set_rotation�_transform_rotates_text�_bbox_patch� _renderer�set_linespacing�set_rotation_mode�update)ry r9 r: r. rc rm rf rg re r! �linespacing�
rotation_mode�usetex�wrap�transform_rotates_textr{ �kwargs� __class__s �r# r z
Text.__init__� s �� �B �����a��������
��
�
�d������&�E�C�L�L��,F� H�����/���������*�*@�J��L�L�):�;� =��
�
�d���"�"�#4�5��$�$�%8�9�-������(�#�'=��$����������K����[�)����}�-����F�rH c �
�� t j |t � }t � }|j d|� }||ur| j |� |j d|� }t �| � |� ||ur| j |� y y )Nre �bbox) r �normalize_kwargsrp �object�popr� r~ r� �set_bbox)ry r� �sentinelre r� r� s �r# r� zText.update� sx �� ��'�'���5���8�����$4�h�?����)��#�#�N�3��z�z�&�(�+��
���v���x���M�M�$�� rH c �. �� t �| � � }d |d<