| Server IP : 35.80.110.71 / Your IP : 216.73.216.170 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/backends/__pycache__/ |
Upload File : |
�
G8�cT � � � d Z ddlmZ ddlmZ ddlmZmZmZm Z ddl
mZ G d� de � Z G d� d e� Z
d
d�d�Z G d
� de� Z G d� de� ZeZeZy
)a�
A fully functional, do-nothing backend intended as a template for backend
writers. It is fully functional in that you can select it as a backend e.g.
with ::
import matplotlib
matplotlib.use("template")
and your program will (should!) run without error, though no output is
produced. This provides a starting point for backend writers; you can
selectively implement drawing methods (`~.RendererTemplate.draw_path`,
`~.RendererTemplate.draw_image`, etc.) and slowly see your figure come to life
instead having to have a full blown implementation before getting any results.
Copy this file to a directory outside of the Matplotlib source tree, somewhere
where Python can import it (by adding the directory to your ``sys.path`` or by
packaging it as a normal Python package); if the backend is importable as
``import my.backend`` you can then select it using ::
import matplotlib
matplotlib.use("module://my.backend")
If your backend implements support for saving figures (i.e. has a `print_xyz`
method), you can register it as the default handler for a given file type::
from matplotlib.backend_bases import register_backend
register_backend('xyz', 'my_backend', 'XYZ File Format')
...
plt.savefig("figure.xyz")
� )�_api)�Gcf)�FigureCanvasBase�FigureManagerBase�GraphicsContextBase�RendererBase)�Figurec �V � � e Zd ZdZ� fd�Zdd�Zd� Zdd�Zd� Zd� Z d� Z
d � Zd
� Z� xZ
S )
�RendererTemplatez�
The renderer handles drawing/rendering operations.
This is a minimal do-nothing class that can be used to get started when
writing a new backend. Refer to `.backend_bases.RendererBase` for
documentation of the methods.
c �0 �� t �| � � || _ y �N)�super�__init__�dpi)�selfr � __class__s ��F/usr/lib/python3/dist-packages/matplotlib/backends/backend_template.pyr zRendererTemplate.__init__0 s �� �
������� c � � y r
� )r �gc�path� transform�rgbFaces r � draw_pathzRendererTemplate.draw_path4 � � �r c � � y r
r )r r �x�y�ims r �
draw_imagezRendererTemplate.draw_imageO r r c � � y r
r ) r r r r �s�prop�angle�ismath�mtexts r � draw_textzRendererTemplate.draw_textR r r c � � y)NTr �r s r �flipyzRendererTemplate.flipyU s � �r c � � y)N)�d r- r r* s r �get_canvas_width_heightz(RendererTemplate.get_canvas_width_heightY s � �r c � � y)N)� r0 r0 r )r r# r$ r&