OwlCyberSecurity - MANAGER
Edit File: legend.cpython-38.pyc
U ��]m� � @ sn d Z ddlZddlZddlmZ ddlmZ ddlmZmZ ddlm Z m Z ddlmZm Z mZ ddlmZ dd lmZ dd lmZmZmZmZ ddlmZmZmZmZmZ ddlmZm Z m!Z! dd lm"Z"m#Z# ddl$m%Z%m&Z&m'Z'm(Z( ddl$m)Z) ddl*m+Z+m,Z,m-Z- ddl.m/Z/ G dd� de)�Z0dZ1ej2j3e1d� G dd� de �Z4d dd�Z5d!dd�Z6ddd�dd�Z7dS )"aO The legend module defines the Legend class, which is responsible for drawing legends associated with axes and/or figures. .. important:: It is unlikely that you would ever create a Legend instance manually. Most users would normally create a legend via the :meth:`~matplotlib.axes.Axes.legend` function. For more details on legends there is also a :doc:`legend guide </tutorials/intermediate/legend_guide>`. The Legend class can be considered as a container of legend handles and legend texts. Creation of corresponding legend handles from the plot elements in the axes or figures (e.g., lines, patches, etc.) are specified by the handler map, which defines the mapping between the plot elements and the legend handlers to be used (the default legend handlers are defined in the :mod:`~matplotlib.legend_handler` module). Note that not all kinds of artist are supported by the legend yet by default but it is possible to extend the legend handler's capabilities to support arbitrary objects. See the :doc:`legend guide </tutorials/intermediate/legend_guide>` for more information. � N)�cbook)�rcParams)r � docstring)�Artist�allow_rasterization)�silent_list�is_hashable�warn_deprecated)�FontProperties)�Line2D)�Patch� Rectangle�Shadow�FancyBboxPatch)�LineCollection�RegularPolyCollection�CircleCollection�PathCollection�PolyCollection)�Bbox�BboxBase�TransformedBbox)�BboxTransformTo�BboxTransformFrom)�HPacker�VPacker�TextArea�DrawingArea)�DraggableOffsetBox)�ErrorbarContainer�BarContainer� StemContainer� )�legend_handlerc @ s6 e Zd Zddd�Zdd� Zdd� Zd d � Zdd� Zd S )�DraggableLegendF�locc C s: || _ |dkr|| _ntd| ��tj| ||j|d� dS )a� Wrapper around a `.Legend` to support mouse dragging. Parameters ---------- legend : `.Legend` The `.Legend` instance to wrap. use_blit : bool, optional Use blitting for faster image composition. For details see :ref:`func-animation`. update : {'loc', 'bbox'}, optional If "loc", update the *loc* parameter of the legend upon finalizing. If "bbox", update the *bbox_to_anchor* parameter. )r% �bbox�'update parameter '%s' is not supported.)�use_blitN)�legend�_update� ValueErrorr �__init__�_legend_box)�selfr) r( �update� r0 �3/usr/lib/python3/dist-packages/matplotlib/legend.pyr, 2 s ��zDraggableLegend.__init__c C s | j �|�S �N)r) �contains)r. r) Zevtr0 r0 r1 � artist_pickerL s zDraggableLegend.artist_pickerc C sF | � � }| jdkr| �|� n$| jdkr4| �|� ntd| j ��d S )Nr% r&