| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/matplotlib/__pycache__/ |
Upload File : |
o
�:�a� � @ s� d Z ddlZddlmZmZmZ ddlmZ ddl
mZ ddl
mZ ddlmZ ddlmZ ddlmZ ddlmZmZmZ ddlmZmZmZ dZd d
� Zd1dd
�Z d2dd�Z!G dd� de j"�Z#G dd� de#�Z$G dd� de$�Z%G dd� de$�Z&G dd� de#�Z'G dd� de#�Z(G dd� de#�Z)G dd � d e#�Z*G d!d"� d"e#�Z+d#d$� Z,G d%d&� d&e+�Z-G d'd(� d(e#�Z.G d)d*� d*e j"ej/�Z0G d+d,� d,�Z1G d-d.� d.e1�Z2G d/d0� d0e1�Z3dS )3ac
Container classes for `.Artist`\s.
`OffsetBox`
The base of all container artists defined in this module.
`AnchoredOffsetbox`, `AnchoredText`
Anchor and align an arbitrary `.Artist` or a text relative to the parent
axes or a specific anchor point.
`DrawingArea`
A container with fixed width and height. Children have a fixed position
inside the container and may be clipped.
`HPacker`, `VPacker`
Containers for layouting their children vertically or horizontally.
`PaddedBox`
A container to add a padding around an `.Artist`.
`TextArea`
Contains a single `.Text` instance.
� N)�_api� docstring�rcParams)�FontProperties)� BboxImage)�FancyBboxPatch�FancyArrowPatch�bbox_artist)�Bbox�BboxBase�TransformedBboxFc O s t rt| i |�� d S d S �N)�DEBUG�mbbox_artist)�args�kwargs� r �6/usr/lib/python3/dist-packages/matplotlib/offsetbox.pyr + s �r �fixedc sH t | � \}}tjg d�|d� |dkr6t�dg� fdd�|D � �}|dd� }|du r2|d � }||fS |d krn|du r@d
}t|�d
krS|t|� t|�d
� nd� t�dg� fdd�|D � �}|dd� }||fS |dkr�t|�}|du r�� du r�td
��|� t|� }n|t|� | � |� t� t|�� }||fS dS )a�
Pack boxes specified by their ``(width, xdescent)`` pair.
For simplicity of the description, the terminology used here assumes a
horizontal layout, but the function works equally for a vertical layout.
*xdescent* is analogous to the usual descent, but along the x-direction; it
is currently ignored.
There are three packing *mode*\s:
- 'fixed': The elements are packed tight to the left with a spacing of
*sep* in between. If *total* is *None* the returned total will be the
right edge of the last box. A non-*None* total will be passed unchecked
to the output. In particular this means that right edge of the last
box may be further to the right than the returned total.
- 'expand': Distribute the boxes with equal spacing so that the left edge
of the first box is at 0, and the right edge of the last box is at
*total*. The parameter *sep* is ignored in this mode. A total of *None*
is accepted and considered equal to 1. The total is returned unchanged
(except for the conversion *None* to 1). If the total is smaller than
the sum of the widths, the laid out boxes will overlap.
- 'equal': If *total* is given, the total space is divided in N equal
ranges and each box is left-aligned within its subspace.
Otherwise (*total* is *None*), *sep* must be provided and each box is
left-aligned in its subspace of width ``(max(widths) + sep)``. The
total width is then calculated to be ``N * (max(widths) + sep)``.
Parameters
----------
wd_list : list of (float, float)
(width, xdescent) of boxes to be packed.
total : float or None
Intended total length. *None* if not used.
sep : float
Spacing between boxes.
mode : {'fixed', 'expand', 'equal'}
The packing mode.
Returns
-------
total : float
The total width needed to accommodate the laid out boxes.
offsets : array of float
The left offsets of the boxes.
)r �expand�equal)�moder r c � g | ]}|� �qS r r ��.0�w��sepr r �
<listcomp>e � z'_get_packed_offsets.<locals>.<listcomp>N���r � c r r r r r r r r t r r z@total and sep cannot both be None when using layout mode 'equal')
�zipr �
check_in_list�np�cumsum�len�sum�max�
ValueError�arange) �wd_list�totalr r �w_list�d_list�offsets_�offsets�maxhr r r �_get_packed_offsets0 s6 1�r2 �baselinec s� � du r
t dd� | D ��� tjg d�|d� |dkr8t dd� | D ��}t dd� | D ��}|| � d d
� | D �}n-|dv rFd}d
d
� | D �}n|dv rVd}� fdd
�| D �}n|dkred}� fdd
�| D �}� ||fS )au
Align boxes each specified by their ``(height, descent)`` pair.
For simplicity of the description, the terminology used here assumes a
horizontal layout (i.e., vertical alignment), but the function works
equally for a vertical layout.
Parameters
----------
hd_list
List of (height, xdescent) of boxes to be aligned.
height : float or None
Intended total height. If None, the maximum of the heights in *hd_list*
is used.
align : {'baseline', 'left', 'top', 'right', 'bottom', 'center'}
The alignment anchor of the boxes.
Returns
-------
height
The total height of the packing (if a value was originally passed in,
it is returned without checking that it is actually large enough).
descent
The descent of the packing.
offsets
The bottom offsets of the boxes.
Nc s s � | ]\}}|V qd S r
r �r �h�dr r r � <genexpr>� � � z'_get_aligned_offsets.<locals>.<genexpr>)r3 �left�top�right�bottom�center)�alignr3 c s s � | ] \}}|| V qd S r
r r4 r r r r7 � s � c s s � | ]\}}|V qd S r
r r4 r r r r7 � r8 c S s g | ]\}}d �qS )� r r4 r r r r � r z(_get_aligned_offsets.<locals>.<listcomp>)r9 r: r? c S s g | ]\}}|�qS r r r4 r r r r � r )r; r<