| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 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� � � � d Z ddlZddlZddlZddlZddlmZ ddlZddl Z
ddl mZmZ ddl m
Z ej e� ZdZ G d� d� Z G d � d
� Z G d� de� Z G d
� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� d e� Z G d!� d"e� Z G d#� d$e� Z! G d%� d&e� Z" G d'� d(e� Z# G d)� d*e#� Z$ G d+� d,e#� Z% G d-� d.e#� Z& G d/� d0e#� Z' G d1� d2e#� Z(dRd3�Z) G d4� d5� Z* G d6� d7e#� Z+ ejX d8� dSd:d;�d<�� Z-d9dd=�d>�Z.d?� Z/d@� Z0dA� Z1dB� Z2 ejX d8� d:dC�dD�� Z3dE� Z4 G dF� dGe#� Z5 G dH� dIe#� Z6 G dJ� dKe#� Z7 G dL� dMe+� Z8 G dN� dOe+� Z9 G dP� dQe#� Z:y)Ta�
Tick locating and formatting
============================
This module contains classes for configuring tick locating and formatting.
Generic tick locators and formatters are provided, as well as domain specific
custom ones.
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.
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:
======================= =======================================================
`AutoLocator` `MaxNLocator` with simple defaults. This is the default
tick locator for most plotting.
`MaxNLocator` Finds up to a max number of intervals with ticks at
nice locations.
`LinearLocator` Space ticks evenly from min to max.
`LogLocator` Space ticks logarithmically from min to max.
`MultipleLocator` Ticks and range are a multiple of base; either integer
or float.
`FixedLocator` Tick locations are fixed.
`IndexLocator` Locator for index plots (e.g., where
``x = range(len(y))``).
`NullLocator` No ticks.
`SymmetricalLogLocator` Locator for use with the symlog norm; works like
`LogLocator` for the part outside of the threshold and
adds 0 if inside the limits.
`AsinhLocator` Locator for use with the asinh norm, attempting to
space ticks approximately uniformly.
`LogitLocator` Locator for logit scaling.
`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 :mod:`.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.
.. note::
`Locator` instances should not be used with more than one
`~matplotlib.axis.Axis` or `~matplotlib.axes.Axes`. So instead of::
locator = MultipleLocator(5)
ax.xaxis.set_major_locator(locator)
ax2.xaxis.set_major_locator(locator)
do the following instead::
ax.xaxis.set_major_locator(MultipleLocator(5))
ax2.xaxis.set_major_locator(MultipleLocator(5))
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.
========================= =====================================================
`NullFormatter` No labels on the ticks.
`FixedFormatter` Set the strings manually for the labels.
`FuncFormatter` User defined function sets the labels.
`StrMethodFormatter` Use string `format` method.
`FormatStrFormatter` Use an old-style sprintf format string.
`ScalarFormatter` Default formatter for scalars: autopick the format
string.
`LogFormatter` Formatter for log axes.
`LogFormatterExponent` Format values for log axis using
``exponent = log_base(value)``.
`LogFormatterMathtext` Format values for log axis using
``exponent = log_base(value)`` using Math text.
`LogFormatterSciNotation` Format values for log axis using scientific notation.
`LogitFormatter` Probability formatter.
`EngFormatter` Format labels in engineering notation.
`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)
In addition to a `.Formatter` instance, `~.Axis.set_major_formatter` and
`~.Axis.set_minor_formatter` also accept a ``str`` or function. ``str`` input
will be internally replaced with an autogenerated `.StrMethodFormatter` with
the input ``str``. For function input, a `.FuncFormatter` with the input
function will be generated and used.
See :doc:`/gallery/ticks/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)�Integral)�_api�cbook)�
transforms)�
TickHelper� Formatter�FixedFormatter�
NullFormatter�
FuncFormatter�FormatStrFormatter�StrMethodFormatter�ScalarFormatter�LogFormatter�LogFormatterExponent�LogFormatterMathtext�LogFormatterSciNotation�LogitFormatter�EngFormatter�PercentFormatter�Locator�IndexLocator�FixedLocator�NullLocator�
LinearLocator�
LogLocator�AutoLocator�MultipleLocator�MaxNLocator�AutoMinorLocator�SymmetricalLogLocator�AsinhLocator�LogitLocatorc � � e Zd ZdZ ej dd�� Z ej dd�� Zdd�Zd� Zd� Z d � Z
d
� Zd� Zd� Z
y
)�
_DummyAxis�dummy�3.6z+get_data_interval() and set_data_interval()��alternativez+get_view_interval() and set_view_interval()c � � t j j � | _ t j j � | _ || _ y �N)�mtransforms�Bbox�unit�_dataLim�_viewLim�_minpos)�self�minposs �3/usr/lib/python3/dist-packages/matplotlib/ticker.py�__init__z_DummyAxis.__init__� s5 � �#�(�(�-�-�/��
�#�(�(�-�-�/��
���� c �. � | j j S r* �r/ � intervalx�r1 s r3 �get_view_intervalz_DummyAxis.get_view_interval� � � ��}�}�&�&�&r5 c �* � ||f| j _ y r* r7 �r1 �vmin�vmaxs r3 �set_view_intervalz_DummyAxis.set_view_interval� � � �"&��*��
�
�r5 c � � | j S r* )r0 r9 s r3 �
get_minposz_DummyAxis.get_minpos� � � ��|�|�r5 c �. � | j j S r* �r. r8 r9 s r3 �get_data_intervalz_DummyAxis.get_data_interval� r; r5 c �* � ||f| j _ y r* rF r= s r3 �set_data_intervalz_DummyAxis.set_data_interval� rA r5 c � � y)N� � r9 s r3 �get_tick_spacez_DummyAxis.get_tick_space� s � �r5 N�r )�__name__�
__module__�__qualname__r �deprecate_privatize_attribute�dataLim�viewLimr4 r: r@ rC rG rI rM rL r5 r3 r$ r$ � s^ � ��H� 1�d�0�0�
�H�J�G�0�d�0�0�
�H�J�G��
'�-��'�-�r5 r$ c � � e Zd ZdZd� Zd� Z ej dd�� d� � Z ej dd�� d � � Z ej dd
�� d� � Z
y)r Nc � � || _ y r* )�axis)r1 rW s r3 �set_axiszTickHelper.set_axis� s � ��� r5 c �>