§
    µ³Ùg…  ã                   óˆ   — d dl Zd dlmZ g d¢Zed	d„¦   «         Zd„ Zed	d„¦   «         Zed	d„¦   «         Z	ed	d„¦   «         Z
dS )
é    N)Ú	decorator)Údelaunay_plot_2dÚconvex_hull_plot_2dÚvoronoi_plot_2dc                 óf  — dd l m} |€3|                     ¦   «         }|                     ¦   «         } | |fd|i|¤ŽS  t	          |dd„ ¦  «        ¦   «         }|r | |fd|i|¤ŽS 	 |                     d¦  «          | |fd|i|¤Ž|                     |¦  «         S # |                     |¦  «         w xY w)Nr   ÚaxÚisholdc                  ó   — dS )NT© r   ó    úN/granary/edev/quantum/lib/python3.11/site-packages/scipy/spatial/_plotutils.pyú<lambda>z_held_figure.<locals>.<lambda>   s   € ¨T€ r   T)Úmatplotlib.pyplotÚpyplotÚfigureÚgcaÚgetattrÚhold)ÚfuncÚobjr   ÚkwÚpltÚfigÚwas_helds          r   Ú_held_figurer      sí   € à#Ð#Ð#Ð#Ð#Ð#à	€zØ�jŠj‰lŒlˆØ�WŠW‰YŒYˆØˆt�CÐ%Ð%˜BÐ% "Ð%Ð%Ð%ð 3�w�r˜8 \ \Ñ2Ô2Ñ4Ô4€HØð &Øˆt�CÐ%Ð%˜BÐ% "Ð%Ð%Ð%ðØ
�Š�‰ŒˆØˆt�CÐ%Ð%˜BÐ% "Ð%Ð%à
�Š�ÑÔÐÐøˆ�Š�ÑÔÐÐøøøs   Á$B ÂB0c                 ó$  — dt          j        |d¬¦  «        z  }|                     d¬¦  «        |z
  }|                     d¬¦  «        |z   }|                      |d         |d         ¦  «         |                      |d         |d         ¦  «         d S )Ngš™™™™™¹?r   ©Úaxisé   )ÚnpÚptpÚminÚmaxÚset_xlimÚset_ylim)r   ÚpointsÚmarginÚxy_minÚxy_maxs        r   Ú_adjust_boundsr*      s‰   € Ø•2”6˜& qÐ)Ñ)Ô)Ñ)€FØ�ZŠZ˜QˆZÑÔ &Ñ(€FØ�ZŠZ˜QˆZÑÔ &Ñ(€FØ‡K‚K��q”	˜6 !œ9Ñ%Ô%Ð%Ø‡K‚K��q”	˜6 !œ9Ñ%Ô%Ð%Ð%Ð%r   c                 ó,  — | j         j        d         dk    rt          d¦  «        ‚| j         j        \  }}|                     ||d¦  «         |                     ||| j                             ¦   «         ¦  «         t          || j         ¦  «         |j	        S )aB  
    Plot the given Delaunay triangulation in 2-D

    Parameters
    ----------
    tri : scipy.spatial.Delaunay instance
        Triangulation to plot
    ax : matplotlib.axes.Axes instance, optional
        Axes to plot on

    Returns
    -------
    fig : matplotlib.figure.Figure instance
        Figure for the plot

    See Also
    --------
    Delaunay
    matplotlib.pyplot.triplot

    Notes
    -----
    Requires Matplotlib.

    Examples
    --------

    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> from scipy.spatial import Delaunay, delaunay_plot_2d

    The Delaunay triangulation of a set of random points:

    >>> rng = np.random.default_rng()
    >>> points = rng.random((30, 2))
    >>> tri = Delaunay(points)

    Plot it:

    >>> _ = delaunay_plot_2d(tri)
    >>> plt.show()

    r   é   z!Delaunay triangulation is not 2-DÚo)
r&   ÚshapeÚ
ValueErrorÚTÚplotÚtriplotÚ	simplicesÚcopyr*   r   )Útrir   ÚxÚys       r   r   r   $   sŠ   € ðZ „zÔ˜Ô˜aÒÐÝÐ<Ñ=Ô=Ð=àŒ:Œ<�D€A€qØ‡G‚GˆAˆq�#ÑÔÐØ‡J‚Jˆq�!�S”]×'Ò'Ñ)Ô)Ñ*Ô*Ð*å�2�s”zÑ"Ô"Ð"àŒ9Ðr   c                 ód  ‡ — ddl m} ‰ j        j        d         dk    rt	          d¦  «        ‚|                     ‰ j        dd…df         ‰ j        dd…df         d¦  «         ˆ fd„‰ j        D ¦   «         }|                      ||d	d
¬¦  «        ¦  «         t          |‰ j        ¦  «         |j	        S )a&  
    Plot the given convex hull diagram in 2-D

    Parameters
    ----------
    hull : scipy.spatial.ConvexHull instance
        Convex hull to plot
    ax : matplotlib.axes.Axes instance, optional
        Axes to plot on

    Returns
    -------
    fig : matplotlib.figure.Figure instance
        Figure for the plot

    See Also
    --------
    ConvexHull

    Notes
    -----
    Requires Matplotlib.


    Examples
    --------

    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> from scipy.spatial import ConvexHull, convex_hull_plot_2d

    The convex hull of a random set of points:

    >>> rng = np.random.default_rng()
    >>> points = rng.random((30, 2))
    >>> hull = ConvexHull(points)

    Plot it:

    >>> _ = convex_hull_plot_2d(hull)
    >>> plt.show()

    r   ©ÚLineCollectionr   r,   zConvex hull is not 2-DNr-   c                 ó*   •— g | ]}‰j         |         ‘ŒS r   )r&   )Ú.0ÚsimplexÚhulls     €r   ú
<listcomp>z'convex_hull_plot_2d.<locals>.<listcomp>�   s    ø€ ÐHÐHÐH¨g�T”[ Ô)ÐHÐHÐHr   ÚkÚsolid)ÚcolorsÚ	linestyle)
Úmatplotlib.collectionsr:   r&   r.   r/   r1   r3   Úadd_collectionr*   r   )r>   r   r:   Úline_segmentss   `   r   r   r   ]   sÚ   ø€ ðZ 6Ð5Ð5Ð5Ð5Ð5à„{Ô˜Ô˜qÒ Ð ÝÐ1Ñ2Ô2Ð2à‡G‚GˆDŒK˜˜˜˜1˜Ô˜tœ{¨1¨1¨1¨a¨4Ô0°#Ñ6Ô6Ð6ØHÐHÐHÐH¸¼ÐHÑHÔH€MØ×Ò�n�n ]Ø,/Ø/6ð8ñ 8ô 8ñ 9ô 9ð 9õ �2�t”{Ñ#Ô#Ð#àŒ9Ðr   c           	      óú  — ddl m} | j        j        d         dk    rt	          d¦  «        ‚|                     dd¦  «        rM|                     dd	¦  «        }|                     | j        d	d	…df         | j        d	d	…df         d
|¬¦  «         |                     dd¦  «        r5|                     | j        d	d	…df         | j        d	d	…df         d¦  «         |                     dd¦  «        }|                     dd¦  «        }|                     dd¦  «        }| j                             d¬¦  «        }t          j
        | j        d¬¦  «        }	g }
g }t          | j        | j        ¦  «        D �]©\  }}t          j        |¦  «        }t          j        |dk    ¦  «        r!|
                     | j        |         ¦  «         ŒS||dk             d         }| j        |d                  | j        |d                  z
  }|t          j                             |¦  «        z  }t          j        |d          |d         g¦  «        }| j        |                              d¬¦  «        }t          j        t          j        ||z
  |¦  «        ¦  «        |z  }| j        r| }t/          |	                     ¦   «         |	                     ¦   «         z  ¦  «        }| j        |         ||	                     ¦   «         z  |z  z   }|                     | j        |         |g¦  «         �Œ«|                      ||
|||d¬¦  «        ¦  «         |                      |||||d¬¦  «        ¦  «         t7          || j        ¦  «         |j        S )ae  
    Plot the given Voronoi diagram in 2-D

    Parameters
    ----------
    vor : scipy.spatial.Voronoi instance
        Diagram to plot
    ax : matplotlib.axes.Axes instance, optional
        Axes to plot on
    show_points : bool, optional
        Add the Voronoi points to the plot.
    show_vertices : bool, optional
        Add the Voronoi vertices to the plot.
    line_colors : string, optional
        Specifies the line color for polygon boundaries
    line_width : float, optional
        Specifies the line width for polygon boundaries
    line_alpha : float, optional
        Specifies the line alpha for polygon boundaries
    point_size : float, optional
        Specifies the size of points

    Returns
    -------
    fig : matplotlib.figure.Figure instance
        Figure for the plot

    See Also
    --------
    Voronoi

    Notes
    -----
    Requires Matplotlib. For degenerate input, including collinearity and
    other violations of general position, it may be preferable to
    calculate the Voronoi diagram with Qhull options ``QJ`` for random
    joggling, or ``Qt`` to enforce triangulated output. Otherwise, some
    Voronoi regions may not be visible.

    Examples
    --------
    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> from scipy.spatial import Voronoi, voronoi_plot_2d

    Create a set of points for the example:

    >>> rng = np.random.default_rng()
    >>> points = rng.random((10,2))

    Generate the Voronoi diagram for the points:

    >>> vor = Voronoi(points)

    Use `voronoi_plot_2d` to plot the diagram:

    >>> fig = voronoi_plot_2d(vor)

    Use `voronoi_plot_2d` to plot the diagram again, with some settings
    customized:

    >>> fig = voronoi_plot_2d(vor, show_vertices=False, line_colors='orange',
    ...                       line_width=2, line_alpha=0.6, point_size=2)
    >>> plt.show()

    r   r9   r   r,   zVoronoi diagram is not 2-DÚshow_pointsTÚ
point_sizeNú.)Ú
markersizeÚshow_verticesr-   Úline_colorsr@   Ú
line_widthg      ð?Ú
line_alphar   rA   )rB   ÚlwÚalpharC   Údashed)rD   r:   r&   r.   r/   Úgetr1   ÚverticesÚmeanr    r!   ÚzipÚridge_pointsÚridge_verticesÚasarrayÚallÚappendÚlinalgÚnormÚarrayÚsignÚdotÚfurthest_siteÚabsr#   r"   rE   r*   r   )Úvorr   r   r:   rI   rM   rN   rO   ÚcenterÚ	ptp_boundÚfinite_segmentsÚinfinite_segmentsÚpointidxr=   ÚiÚtÚnÚmidpointÚ	directionÚaspect_factorÚ	far_points                        r   r   r   ™   ss  € ðH 6Ð5Ð5Ð5Ð5Ð5à
„zÔ˜Ô˜aÒÐÝÐ5Ñ6Ô6Ð6à	‡v‚vˆm˜TÑ"Ô"ð PØ—V’V˜L¨$Ñ/Ô/ˆ
Ø
�Š�”
˜1˜1˜1˜a˜4Ô  #¤*¨Q¨Q¨Q°¨TÔ"2°CÀJˆÑOÔOÐOØ	‡v‚vˆo˜tÑ$Ô$ð =Ø
�Š�”˜Q˜Q˜Q ˜TÔ" C¤L°°°°A°Ô$6¸Ñ<Ô<Ð<à—&’&˜¨Ñ,Ô,€KØ—’˜ cÑ*Ô*€JØ—’˜ cÑ*Ô*€JàŒZ�_Š_ !ˆ_Ñ$Ô$€FÝ”�s”z¨Ð*Ñ*Ô*€Ià€OØÐÝ  Ô!1°3Ô3EÑFÔFð Cñ CÑˆ�'Ý”*˜WÑ%Ô%ˆÝŒ6�'˜Q’,ÑÔð 	CØ×"Ò" 3¤<°Ô#8Ñ9Ô9Ð9Ð9à˜ 1šÔ% aÔ(ˆAà”
˜8 Aœ;Ô'¨#¬*°X¸a´[Ô*AÑAˆAØ•”—’ Ñ"Ô"Ñ"ˆAÝ”˜1˜Qœ4˜%  1¤˜Ñ'Ô'ˆAà”z (Ô+×0Ò0°aÐ0Ñ8Ô8ˆHÝœ¥¤ x°&Ñ'8¸!Ñ <Ô <Ñ=Ô=ÀÑAˆIØÔ!ð 'Ø&˜J�	Ý 	§¢¡¤°)·-²-±/´/Ñ AÑBÔBˆMØœ Qœ¨)°i·m²m±o´oÑ*EÈÑ*UÑUˆIà×$Ò$ c¤l°1¤o°yÐ%AÑBÔBÐBÑBà×Ò�n�n _Ø,7Ø(2Ø+5Ø/6ð	8ñ 8ô 8ñ 9ô 9ð 9ð
 ×Ò�n�nÐ%6Ø,7Ø(2Ø+5Ø/7ð	9ñ 9ô 9ñ :ô :ð :õ �2�s”zÑ"Ô"Ð"àŒ9Ðr   )N)Únumpyr    Úscipy._lib.decoratorr   Ú
_decoratorÚ__all__r   r*   r   r   r   r   r   r   ú<module>rt      sÏ   ðØ Ð Ð Ð Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8à
HÐ
HÐ
H€ð ðð ð ñ „ðð(&ð &ð &ð ð5ð 5ð 5ñ „ð5ðp ð8ð 8ð 8ñ „ð8ðv ðxð xð xñ „ðxð xð xr   