
    \cgk                     T    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y)
    )
MethodTypeN   )make_axes_locatableSize)AxesSimpleAxisArtistc                    t        |       }|t        j                  |       z  }dd|z  z
  dz  t        j                  |       z  }dd|z  z
  dz  t        j                  |       z  }|j	                  t        j                  |       ||g       |j                  |||||g       | j                  |j                  ddd             g }|t        |       }dD ]  }	 || j                         | j                  d	      f| | d
|}
|j                  d|	      }|
j                  |       |
j                  j                         |
j                  j                         z   D ]  }|j                  d        	 |
j                  j!                         D ]  }|j"                  j                  d        	 |j'                  |
        | j                         }|D ]  }
|j)                  |
        |S # t$        $ r Y Hw xY w)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   )ny1)   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/bid-api/venv/lib/python3.12/site-packages/mpl_toolkits/axes_grid1/axes_rgb.pymake_rgb_axesr5   	   s    ""%GTZZ^#H#gq[DJJrN*E#gq[DJJrN*EDJJrNHe<=%5(EBC++Aqb+9:F"X
"//4/*H 9 "29179%%r%2W%))+cii.F.F.HHAMM%  I	)%%11%8 *
 	c  --/CS  M  		s   5:G--	G98G9c                   &    e Zd ZdZeZdddZd Zy)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                p   |j                  d| j                        } ||i |x| _        }|j                         j	                  |       t        |f||d|\  | _        | _        | _        | j                  | j                  | j                  | j                  fD ]  }t        |j                  t              rt        j                  |       }|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&                  j)                  d       |d
d
 j*                  j-                  d        y
)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)r9   r:   r;   r<   Nw)pop_defaultAxesClassRGBr   r&   r5   RGB
isinstancer!   r   r   AxisDictupdater   r   spinesr   line	set_colormajor_ticksset_markeredgecolor)selfr(   argsr*   r)   r'   r0   ads           r4   __init__zRGBAxes.__init__]   s`    ZZd.D.DE
"D3F332
  $!.":J":28": HHdffdffdff5C#((J/]]4(		+CIIq#**X:NO(Aszz%7HI)#))Q

68JK*399aG9LM	  O XXqEJJ  %qE11#6 6    c           	         |j                   |j                   cxk(  r|j                   k(  s5n 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_liker@   imshowrA   rB   rC   )rL   rgbr*   r@   rA   rB   rC   im_rgbim_rim_gim_bs                r4   
imshow_rgbzRGBAxes.imshow_rgb}   s.   $ 177-agg- 	AGG9Bqwwi~NP PiiAq	"MM#!Q'
MM#!Q'
MM#!Q'
 //tvv}}Q)&)tvv}}Q)&)tvv}}Q)&)tT4''rP   N)__name__
__module____qualname____doc__r   r?   rO   r_    rP   r4   r7   r7   >   s    8 "# 7@ (rP   r7   )g{Gz?N)typesr   numpyrT   axes_dividerr   r   mpl_axesr   r   r5   r7   rd   rP   r4   <module>ri      s#      3 ,2j_( _(rP   