OwlCyberSecurity - MANAGER
Edit File: markers.cpython-38.pyc
U ��]�� � @ s� d Z ddlmZ ddlmZ ddlZddlmZm Z ddl mZ ddlm Z mZ ed �\ZZZZZZZZZZZZee�d ��ZG dd� de�ZdS ) u` This module contains functions to handle markers. Used by both the marker functionality of `~matplotlib.axes.Axes.plot` and `~matplotlib.axes.Axes.scatter`. All possible markers are defined here: ============================== ====== ========================================= marker symbol description ============================== ====== ========================================= ``"."`` |m00| point ``","`` |m01| pixel ``"o"`` |m02| circle ``"v"`` |m03| triangle_down ``"^"`` |m04| triangle_up ``"<"`` |m05| triangle_left ``">"`` |m06| triangle_right ``"1"`` |m07| tri_down ``"2"`` |m08| tri_up ``"3"`` |m09| tri_left ``"4"`` |m10| tri_right ``"8"`` |m11| octagon ``"s"`` |m12| square ``"p"`` |m13| pentagon ``"P"`` |m23| plus (filled) ``"*"`` |m14| star ``"h"`` |m15| hexagon1 ``"H"`` |m16| hexagon2 ``"+"`` |m17| plus ``"x"`` |m18| x ``"X"`` |m24| x (filled) ``"D"`` |m19| diamond ``"d"`` |m20| thin_diamond ``"|"`` |m21| vline ``"_"`` |m22| hline ``0`` (``TICKLEFT``) |m25| tickleft ``1`` (``TICKRIGHT``) |m26| tickright ``2`` (``TICKUP``) |m27| tickup ``3`` (``TICKDOWN``) |m28| tickdown ``4`` (``CARETLEFT``) |m29| caretleft ``5`` (``CARETRIGHT``) |m30| caretright ``6`` (``CARETUP``) |m31| caretup ``7`` (``CARETDOWN``) |m32| caretdown ``8`` (``CARETLEFTBASE``) |m33| caretleft (centered at base) ``9`` (``CARETRIGHTBASE``) |m34| caretright (centered at base) ``10`` (``CARETUPBASE``) |m35| caretup (centered at base) ``11`` (``CARETDOWNBASE``) |m36| caretdown (centered at base) ``"None"``, ``" "`` or ``""`` nothing ``'$...$'`` |m37| Render the string using mathtext. E.g ``"$f$"`` for marker showing the letter ``f``. ``verts`` A list of (x, y) pairs used for Path vertices. The center of the marker is located at (0,0) and the size is normalized, such that the created path is encapsulated inside the unit cell. path A `~matplotlib.path.Path` instance. ``(numsides, style, angle)`` The marker can also be a tuple ``(numsides, style, angle)``, which will create a custom, regular symbol. ``numsides``: the number of sides ``style``: the style of the regular symbol: - 0: a regular polygon - 1: a star-like symbol - 2: an asterisk - 3: a circle (``numsides`` and ``angle`` is ignored); deprecated. ``angle``: the angle of rotation of the symbol ============================== ====== ========================================= For backward compatibility, the form ``(verts, 0)`` is also accepted, but it is deprecated and equivalent to just ``verts`` for giving a raw set of vertices that define the shape. ``None`` is the default which means 'nothing', however this table is referred to from other docs for the valid inputs from marker inputs and in those cases ``None`` still means 'default'. Note that special symbols can be defined via the :doc:`STIX math font </tutorials/text/mathtext>`, e.g. ``"$♫$"``. For an overview over the STIX font symbols refer to the `STIX font table <http://www.stixfonts.org/allGlyphs.html>`_. Also see the :doc:`/gallery/text_labels_and_annotations/stix_fonts_demo`. Integer numbers from ``0`` to ``11`` create lines and triangles. Those are equally accessible via capitalized variables, like ``CARETDOWNBASE``. Hence the following are equivalent:: plt.plot([1,2,3], marker=11) plt.plot([1,2,3], marker=matplotlib.markers.CARETDOWNBASE) Examples showing the use of markers: * :doc:`/gallery/lines_bars_and_markers/marker_reference` * :doc:`/gallery/lines_bars_and_markers/marker_fillstyle_reference` * :doc:`/gallery/shapes_and_collections/marker_path` .. |m00| image:: /_static/markers/m00.png .. |m01| image:: /_static/markers/m01.png .. |m02| image:: /_static/markers/m02.png .. |m03| image:: /_static/markers/m03.png .. |m04| image:: /_static/markers/m04.png .. |m05| image:: /_static/markers/m05.png .. |m06| image:: /_static/markers/m06.png .. |m07| image:: /_static/markers/m07.png .. |m08| image:: /_static/markers/m08.png .. |m09| image:: /_static/markers/m09.png .. |m10| image:: /_static/markers/m10.png .. |m11| image:: /_static/markers/m11.png .. |m12| image:: /_static/markers/m12.png .. |m13| image:: /_static/markers/m13.png .. |m14| image:: /_static/markers/m14.png .. |m15| image:: /_static/markers/m15.png .. |m16| image:: /_static/markers/m16.png .. |m17| image:: /_static/markers/m17.png .. |m18| image:: /_static/markers/m18.png .. |m19| image:: /_static/markers/m19.png .. |m20| image:: /_static/markers/m20.png .. |m21| image:: /_static/markers/m21.png .. |m22| image:: /_static/markers/m22.png .. |m23| image:: /_static/markers/m23.png .. |m24| image:: /_static/markers/m24.png .. |m25| image:: /_static/markers/m25.png .. |m26| image:: /_static/markers/m26.png .. |m27| image:: /_static/markers/m27.png .. |m28| image:: /_static/markers/m28.png .. |m29| image:: /_static/markers/m29.png .. |m30| image:: /_static/markers/m30.png .. |m31| image:: /_static/markers/m31.png .. |m32| image:: /_static/markers/m32.png .. |m33| image:: /_static/markers/m33.png .. |m34| image:: /_static/markers/m34.png .. |m35| image:: /_static/markers/m35.png .. |m36| image:: /_static/markers/m36.png .. |m37| image:: /_static/markers/m37.png � )�Sized)�NumberN� )�cbook�rcParams)�Path)�IdentityTransform�Affine2D� )r � c R @ s� e Zd Zddddddddd d ddd ddddddddddddddddddd d!d"d#d$d%d%d&d'd(d)d*d+d,d-d.d/d0d1ed2ed3ed4ed5ed6ed7e d8e d9ed:ed;e d<ed=d>d?d@d?dAd?dBd?i)ZdCZdDZdEZdFZd�dGdH�ZdIdJ� ZdKdL� ZdMdN� ZdOdP� ZdQdR� ZdSdT� ZdUdV� ZdWdX� ZdYdZ� Zd[d\� Zd]d^� Zd_d`� Z dadb� Z!dcdd� Z"dedf� Z#dgdh� Z$didj� Z%dkdl� Z&dmdn� Z'dodp� Z(dqdr� Z)d�dtdu�Z*dvdw� Z+dxdy� Z,e-dzdsgd{d{gdsd{gdzdsgge-j.e-j/e-j/e-j0g�Z1e-dzdsgd|d}gd~d}gdzdsgge-j.e-j/e-j/e-j0g�Z2e-d|d}gd~d}gdsd{gd{d{gd|d}gge-j.e-j/e-j/e-j/e-j0g�Z3e-dzdsgdzd{gd{d{gdzdsgge-j.e-j/e-j/e-j0g�Z4e-dzdsgdzd{gdsd{gdzdsgge-j.e-j/e-j/e-j0g�Z5dd�� Z6d�d�� Z7d�d�� Z8d�d�� Z9d�d�� Z:d�d�� Z;d�d�� Z<d�d�� Z=d�d�� Z>d�d�� Z?d�d�� Z@d�d�� ZAd�d�� ZBe-dzd{gdzdsgg�ZCd�d�� ZDd�d�� ZEe-dzdzgdsdzgg�ZFd�d�� ZGd�d�� ZHe-d�dzgd�dsgg�ZId�d�� ZJd�d�� ZKe-dzdzgdzd{gdzdzgd�dFgdzdzgd�dFgge-j.e-j/e-j.e-j/e-j.e-j/g�ZLd�d�� ZMd�d�� ZNd�d�� ZOd�d�� ZPe-d{d�gdzdzgdsd�gg�ZQd�d�� ZRd�d�� ZSd�d�� ZTd�d�� ZUe-d{dzgdzd�gdsd�gg�ZVd�d�� ZWd�d�� ZXd�d�� ZYd�d ZZe-d{dzgdsdzgdzd{gdzdsgge-j.e-j/e-j.e-j/g�Z[d�dĄ Z\e-d{d{gdsdsgd{dsgdsd{gge-j.e-j/e-j.e-j/g�Z]d�dƄ Z^e-d�d�d�d�d�d�d�d�d�d�d�d�d�g e-j.e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j0g �Z_e-d�d�d�d�d�d�d�d�d�g e-j.e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j0g �Z`d�dք Zae-d�d�d�d�d�d�d�d�d�d�d�d�d�g e-j.e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j/e-j0g �Zbe-d�d�d�d�d�d�d�d�ge-j.e-j/e-j/e-j/e-j/e-j/e-j/e-j0g�Zcd�d� Zdd@S )��MarkerStyle�.Zpoint�,Zpixel�oZcircle�vZ triangle_down�^Ztriangle_up�<Z triangle_left�>Ztriangle_right�1Ztri_down�2Ztri_up�3Ztri_left�4Z tri_right�8Zoctagon�sZsquare�pZpentagon�*Zstar�hZhexagon1�HZhexagon2�+Zplus�x�DZdiamond�dZthin_diamond�|Zvline�_Zhline�PZplus_filled�XZx_filledZtickleftZ tickrightZtickupZtickdownZ caretleftZ caretrightZcaretupZ caretdownZ caretleftbaseZcaretrightbaseZcaretupbaseZ caretdownbase�NoneZnothingN� � )r r r r r r r r r r r r r! r$ r% )Zfull�left�right�bottom�topZnone)r) r* r+ r, � �?c C s d| _ | �|� | �|� dS )a� Attributes ---------- markers : list of known marks fillstyles : list of known fillstyles filled_markers : list of known filled markers. Parameters ---------- marker : string or array_like, optional, default: None See the descriptions of possible markers in the module docstring. fillstyle : string, optional, default: 'full' 'full', 'left", 'right', 'bottom', 'top', 'none' N)�_marker_function� set_fillstyle� set_marker)�self�marker� fillstyle� r4 �4/usr/lib/python3/dist-packages/matplotlib/markers.py�__init__� s zMarkerStyle.__init__c C sL | j d krd S t| _t� | _d | _d | _d | _d| _d| _ d| _ | � � d S )N�roundZbuttT)r. �_empty_path�_pathr � _transform� _alt_path�_alt_transform�_snap_threshold� _joinstyle� _capstyle�_filled�r1 r4 r4 r5 �_recache� s zMarkerStyle._recachec C s t t| jj��S �N)�bool�lenr9 �verticesrA r4 r4 r5 �__bool__ s zMarkerStyle.__bool__c C s | j S rC �r@ rA r4 r4 r5 � is_filled s zMarkerStyle.is_filledc C s | j S rC )� _fillstylerA r4 r4 r5 � get_fillstyle s zMarkerStyle.get_fillstylec C s@ |dkrt d }|| jkr.tdd�| j� ��|| _| �� dS )z{ Sets fillstyle Parameters ---------- fillstyle : string amongst known fillstyles Nzmarkers.fillstylezUnrecognized fillstyle %sr'