
    P/Phk                     \    d dl mZ d dlZddlmZmZ ddlmZm	Z	 d
dZ
 G d d	          ZdS )    )
MethodTypeN   )make_axes_locatableSize)AxesSimpleAxisArtist{Gz?c                 N   t          |           }|t          j        |           z  }dd|z  z
  dz  t          j        |           z  }dd|z  z
  dz  t          j        |           z  }|                    t          j        |           ||g           |                    |||||g           |                     |                    ddd                     g }|t          |           }dD ]
}	 || 	                                | 
                    d	
          f| | d|}
|                    d|	          }|
                    |           |
j                                        |
j                                        z   D ]}|                    d           	 |
j                                        D ]}|j                            d           n# t$          $ r Y nw xY w|                    |
           | 	                                }|D ]}
|                    |
           |S )a  
    Parameters
    ----------
    ax : `~matplotlib.axes.Axes`
        Axes instance to create the RGB Axes in.
    pad : float, optional
        Fraction of the Axes height to pad.
    axes_class : `matplotlib.axes.Axes` or None, optional
        Axes class to use for the R, G, and B Axes. If None, use
        the same class as *ax*.
    **kwargs
        Forwarded to *axes_class* init for the R, G, and B Axes.
    r         r   )ny1N)   r   r   T)original)sharexsharey)nxnyF)r   r   AxesYAxesXset_horizontalset_verticalset_axes_locatornew_locatortype
get_figureget_positionyaxisget_ticklabelsxaxisset_visibleaxisvaluesmajor_ticklabelsAttributeErrorappendadd_axes)axpad
axes_classkwargsdividerpad_sizexsizeysizeax_rgbr   ax1locatortr"   figs                  `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mpl_toolkits/axes_grid1/axes_rgb.pymake_rgb_axesr6   	   sN    ""%%GTZ^^#H#gq[DJrNN*E#gq[DJrNN*EDJrNNHe<===%5(EBCCC++Aqb+99:::F"XX
  j"//4/*H*H 9 "29 9179 9%%r%22W%%%))++ci.F.F.H.HH 	! 	!AMM%    	)) 9 9%11%88889 	 	 	D	 	c
--//C  SMs   6G
GGc                   (    e Zd ZdZeZdddZd ZdS )RGBAxesu  
    4-panel `~.Axes.imshow` (RGB, R, G, B).

    Layout::

        ┌───────────────┬─────┐
        │               │  R  │
        │               ├─────┤
        │      RGB      │  G  │
        │               ├─────┤
        │               │  B  │
        └───────────────┴─────┘

    Subclasses can override the ``_defaultAxesClass`` attribute.
    By default RGBAxes uses `.mpl_axes.Axes`.

    Attributes
    ----------
    RGB : ``_defaultAxesClass``
        The Axes object for the three-channel `~.Axes.imshow`.
    R : ``_defaultAxesClass``
        The Axes object for the red channel `~.Axes.imshow`.
    G : ``_defaultAxesClass``
        The Axes object for the green channel `~.Axes.imshow`.
    B : ``_defaultAxesClass``
        The Axes object for the blue channel `~.Axes.imshow`.
    r   )r)   c                J   |                     d| j                  } ||i |x| _        }|                                                    |           t          |f||d|\  | _        | _        | _        | j        | j        | j        | j        fD ]}t          |j
        t                    rt          j        |           }|                    t          |j        d|j        d                   t          |j        d|j        d                   t          |j        d|j        d                   t          |j        d|j        d                   	           n|j
        }|d
d
         j                            d           |d
d
         j                            d           d
S )a  
        Parameters
        ----------
        pad : float, default: 0
            Fraction of the Axes height to put as padding.
        axes_class : `~matplotlib.axes.Axes`
            Axes class to use. If not provided, ``_defaultAxesClass`` is used.
        *args
            Forwarded to *axes_class* init for the RGB Axes
        **kwargs
            Forwarded to *axes_class* init for the RGB, R, G, and B Axes
        r*   )r)   r*   r   bottomr   topleftright)r:   r;   r<   r=   Nw)pop_defaultAxesClassRGBr   r'   r6   RGB
isinstancer"   r   r   AxisDictupdater   r    spinesr   line	set_colormajor_ticksset_markeredgecolor)selfr)   argsr+   r*   r(   r1   ads           r5   __init__zRGBAxes.__init__]   s    ZZd.DEE
"
D3F3332
  $$$!.":J": ":28": ": Hdfdfdf5 	7 	7C#(J// ]4((		+CIq#*X:NOO(Asz%7HII)#)Q
68JKK*39aG9LMM	  O O O O XqqqEJ  %%%qqqE11#6666	7 	7    c           	          |j         |j         cxk    r|j         k    s*n t          d|j          d|j          d|j          d          t          j        |||g          }t          j        |          }||dddddf<   t          j        |          }||dddddf<   t          j        |          }||dddddf<    | j        j        |fi |}	 | j        j        |fi |}
 | j        j        |fi |} | j	        j        |fi |}|	|
||fS )a  
        Create the four images {rgb, r, g, b}.

        Parameters
        ----------
        r, g, b : array-like
            The red, green, and blue arrays.
        **kwargs
            Forwarded to `~.Axes.imshow` calls for the four images.

        Returns
        -------
        rgb : `~matplotlib.image.AxesImage`
        r : `~matplotlib.image.AxesImage`
        g : `~matplotlib.image.AxesImage`
        b : `~matplotlib.image.AxesImage`
        zInput shapes (z, z) do not matchNr   r   r   )
shape
ValueErrornpdstack
zeros_likerA   imshowrB   rC   rD   )rM   rgbr+   rA   rB   rC   rD   im_rgbim_rim_gim_bs                r5   
imshow_rgbzRGBAxes.imshow_rgb}   sd   $ 17----ag----NNNAGNNqwNNNP P PiAq	""M#!!!QQQ'
M#!!!QQQ'
M#!!!QQQ'
 ////tv}Q))&))tv}Q))&))tv}Q))&))tT4''rQ   N)__name__
__module____qualname____doc__r   r@   rP   r`    rQ   r5   r8   r8   >   sR         8 "# 7 7 7 7 7@ (  (  (  (  (rQ   r8   )r	   N)typesr   numpyrU   axes_dividerr   r   mpl_axesr   r   r6   r8   re   rQ   r5   <module>rj      s              3 3 3 3 3 3 3 3 , , , , , , , ,2 2 2 2j_( _( _( _( _( _( _( _( _( _(rQ   