�
��g9� � �� � d Z ddlmZ ddlmZ ddlmZ ddlmZm Z ddl
mZmZm
Z
ddlmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZmZmZmZmZmZ dd
lm Z m!Z! ddl"m#Z# ddl$m%Z% ddlm&Z& ddlm'Z' ddlm(Z( ddlm)Z) ddlm*Z* ddlm+Z+ ddlm,Z, ddlm-Z- ddlm.Z. ddlm/Z/ ddlm0Z0 ddl1m2Z2 dgdgd�Z3d� Z4d� Z5d � Z6d!� Z7d"� Z8eed#�Z9d$d%�d&�Z:d$d%�d'�Z;d$d%�d(�Z<d)� Z=d$d%�d*�Z>d$d%�d+�Z?d$d%�d,�Z@d-� ZAd.S )/a Plotting module for SymPy.
A plot is represented by the ``Plot`` class that contains a reference to the
backend and a list of the data series to be plotted. The data series are
instances of classes meant to simplify getting points and meshes from SymPy
expressions. ``plot_backends`` is a dictionary with all the backends.
This module gives only the essential. For all the fancy stuff use directly
the backend. You can get the backend wrapper for every plot from the
``_backend`` attribute. Moreover the data series classes have various useful
methods like ``get_points``, ``get_meshes``, etc, that may
be useful if you wish to use another plotting library.
Especially if you need publication ready graphs and this module is not enough
for you - just get the ``_backend`` attribute and add whatever you want
directly to it. In the case of matplotlib (the common way to graph data in
python) just copy ``_backend.fig`` which is the figure and ``_backend.ax``
which is the axis and work on them as you would on any other matplotlib object.
Simplicity of code takes much greater importance than performance. Do not use it
if you care at all about performance. A new backend instance is initialized
every time you call ``show()`` and the old one is left to the garbage collector.
� )�Sum)�Tuple)�Expr)�Function�AppliedUndef)�Dummy�Symbol�Wild)�
import_module)�sign)�Plot)�MatplotlibBackend)�TextBackend)�LineOver1DRangeSeries�Parametric2DLineSeries�Parametric3DLineSeries�ParametricSurfaceSeries�SurfaceOver2DRangeSeries�
ContourSeries)�_check_arguments�
_plot_sympify)�Indexed)�PlotGrid)�
BaseSeries)�Line2DBaseSeries)�Line3DBaseSeries)�SurfaceBaseSeries)�List2DSeries)�GenericDataSeries)�centers_of_faces)�centers_of_segments)�flat)�
unset_show)�_matplotlib_list)�textplot�
matplotlib))�plot3d�plot3d_parametric_line�plot3d_parametric_surface�plot_parametric)�plotc � � d� }t |� � }|d }t dd� d� g�� � }t |� |� � � � D ]~}t |j � � }t |� � D ]9\ }}|dk r.|d ||d | � � ||d | � � f||<