OwlCyberSecurity - MANAGER
Edit File: ticker.cpython-38.pyc
U ��]Ul � @ s d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddlm Z e�e �ZdZdd� ZG d d � d e�ZG dd� de�ZG d d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�ZG d#d$� d$e�ZG d%d&� d&e�Z G d'd(� d(e�Z!G d)d*� d*e�Z"G d+d,� d,e�Z#G d-d.� d.e�Z$G d/d0� d0e$�Z%G d1d2� d2e$�Z&G d3d4� d4e$�Z'G d5d6� d6e$�Z(e �)d7�d8d9� �Z*e �)d7�G d:d;� d;e��Z+G d<d=� d=e$�Z,dfd@dA�Z-G dBdC� dC�Z.G dDdE� dEe$�Z/e �)dF�dgdHdI��Z0e �)dF�dhdJdK��Z1dLdM� Z2didNdO�Z3dPdQ� Z4dRdS� Z5dTdU� Z6dVdW� Z7dXdY� Z8G dZd[� d[e$�Z9G d\d]� d]e$�Z:G d^d_� d_e$�Z;G d`da� dae/�Z<G dbdc� dce$�Z=G ddde� dee$�Z>dS )ja� Tick locating and formatting ============================ This module contains classes to support completely configurable tick locating and formatting. Although the locators know nothing about major or minor ticks, they are used by the Axis class to support major and minor tick locating and formatting. Generic tick locators and formatters are provided, as well as domain specific custom ones. Default Formatter ----------------- The default formatter identifies when the x-data being plotted is a small range on top of a large offset. To reduce the chances that the ticklabels overlap, the ticks are labeled as deltas from a fixed offset. For example:: ax.plot(np.arange(2000, 2010), range(10)) will have tick of 0-9 with an offset of +2e3. If this is not desired turn off the use of the offset on the default formatter:: ax.get_xaxis().get_major_formatter().set_useOffset(False) set the rcParam ``axes.formatter.useoffset=False`` to turn it off globally, or set a different formatter. Tick locating ------------- The Locator class is the base class for all tick locators. The locators handle autoscaling of the view limits based on the data limits, and the choosing of tick locations. A useful semi-automatic tick locator is `MultipleLocator`. It is initialized with a base, e.g., 10, and it picks axis limits and ticks that are multiples of that base. The Locator subclasses defined here are :class:`AutoLocator` `MaxNLocator` with simple defaults. This is the default tick locator for most plotting. :class:`MaxNLocator` Finds up to a max number of intervals with ticks at nice locations. :class:`LinearLocator` Space ticks evenly from min to max. :class:`LogLocator` Space ticks logarithmically from min to max. :class:`MultipleLocator` Ticks and range are a multiple of base; either integer or float. :class:`FixedLocator` Tick locations are fixed. :class:`IndexLocator` Locator for index plots (e.g., where ``x = range(len(y))``). :class:`NullLocator` No ticks. :class:`SymmetricalLogLocator` Locator for use with with the symlog norm; works like `LogLocator` for the part outside of the threshold and adds 0 if inside the limits. :class:`LogitLocator` Locator for logit scaling. :class:`OldAutoLocator` Choose a `MultipleLocator` and dynamically reassign it for intelligent ticking during navigation. :class:`AutoMinorLocator` Locator for minor ticks when the axis is linear and the major ticks are uniformly spaced. Subdivides the major tick interval into a specified number of minor intervals, defaulting to 4 or 5 depending on the major interval. There are a number of locators specialized for date locations - see the `dates` module. You can define your own locator by deriving from Locator. You must override the ``__call__`` method, which returns a sequence of locations, and you will probably want to override the autoscale method to set the view limits from the data limits. If you want to override the default locator, use one of the above or a custom locator and pass it to the x or y axis instance. The relevant methods are:: ax.xaxis.set_major_locator(xmajor_locator) ax.xaxis.set_minor_locator(xminor_locator) ax.yaxis.set_major_locator(ymajor_locator) ax.yaxis.set_minor_locator(yminor_locator) The default minor locator is `NullLocator`, i.e., no minor ticks on by default. Tick formatting --------------- Tick formatting is controlled by classes derived from Formatter. The formatter operates on a single tick value and returns a string to the axis. :class:`NullFormatter` No labels on the ticks. :class:`IndexFormatter` Set the strings from a list of labels. :class:`FixedFormatter` Set the strings manually for the labels. :class:`FuncFormatter` User defined function sets the labels. :class:`StrMethodFormatter` Use string `format` method. :class:`FormatStrFormatter` Use an old-style sprintf format string. :class:`ScalarFormatter` Default formatter for scalars: autopick the format string. :class:`LogFormatter` Formatter for log axes. :class:`LogFormatterExponent` Format values for log axis using ``exponent = log_base(value)``. :class:`LogFormatterMathtext` Format values for log axis using ``exponent = log_base(value)`` using Math text. :class:`LogFormatterSciNotation` Format values for log axis using scientific notation. :class:`LogitFormatter` Probability formatter. :class:`EngFormatter` Format labels in engineering notation :class:`PercentFormatter` Format labels as a percentage You can derive your own formatter from the Formatter base class by simply overriding the ``__call__`` method. The formatter class has access to the axis view and data limits. To control the major and minor tick label formats, use one of the following methods:: ax.xaxis.set_major_formatter(xmajor_formatter) ax.xaxis.set_minor_formatter(xminor_formatter) ax.yaxis.set_major_formatter(ymajor_formatter) ax.yaxis.set_minor_formatter(yminor_formatter) See :doc:`/gallery/ticks_and_spines/major_minor_demo` for an example of setting major and minor ticks. See the :mod:`matplotlib.dates` module for more information and examples of using date locators and formatters. � N)�rcParams)�cbook)� transforms)� TickHelper� Formatter�FixedFormatter� NullFormatter� FuncFormatter�FormatStrFormatter�StrMethodFormatter�ScalarFormatter�LogFormatter�LogFormatterExponent�LogFormatterMathtext�IndexFormatter�LogFormatterSciNotation�LogitFormatter�EngFormatter�PercentFormatter�OldScalarFormatter�Locator�IndexLocator�FixedLocator�NullLocator� LinearLocator� LogLocator�AutoLocator�MultipleLocator�MaxNLocator�AutoMinorLocator�SymmetricalLogLocator�LogitLocator�OldAutoLocatorc C s d| S )Nz\mathdefault{%s}� )�sr# r# �3/usr/lib/python3/dist-packages/matplotlib/ticker.py�_mathdefault� s r&