
    >h                     2    S SK Jr  S SKrSS jr   SS jrg)    Nc                    [         R                  " 5       nUc  [        U 5      OUnU nUSU nUR                  S5      nUR	                  [
        R                  " U5      USU S5        UR                  SS9  [
        R                  " UR                  5       5      nUS   US   -
  nUS[
        R                  " U* U/5      -  -  nUR                  [
        R                  " U5      5        UR                  U5        [
        R                  " UR                  5       5      n	Sn
U	S   U	S   -
  nX[
        R                  " U* U/5      -  -  n	UR                  U	5        UR                  S	5        UR                  S
5        UR!                  U5        XQ-  n[
        R"                  " U5      nUR                  S5      nUR	                  [
        R                  " U5      USU S5        UR	                  [
        R                  " U5      USU S5        UR                  SS9  [
        R                  " UR                  5       5      nUS   US   -
  nUS[
        R                  " U* U/5      -  -  nUR                  [
        R                  " U5      5        UR                  U5        [
        R                  " UR                  5       5      n	Sn
U	S   U	S   -
  nX[
        R                  " U* U/5      -  -  n	UR                  U	5        UR                  S5        UR                  S5        UR!                  U5        UR%                  SS/SS9  UR'                  5         U$ )a  
Plot of the ordered eigenvalues and variance explained for the loadings

Parameters
----------
eigenvals : array_like
    The eigenvalues
total_var : float
    the total variance (for plotting percent variance explained)
ncomp : int, optional
    Number of factors to include in the plot.  If None, will
    included the same as the number of maximum possible loadings
x_label : str
    label of x-axis

Returns
-------
Figure
    Handle to the figure.
Ny   zb-oT)tight   r   g{Gz?z
Scree Plot
Eigenvaluez   zg--ozVariance Explained
Proportion
Cumulative   )loc)pltfigurelenadd_subplotplotnparange	autoscalearrayget_xlim
set_xticksset_xlimget_ylimset_ylim	set_title
set_ylabel
set_xlabelcumsumlegendtight_layout)	eigenvals	total_varncompx_labelfigvalsaxxlimspylimscaleper_variancecumper_variances                qC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\statsmodels/multivariate/plots.py
plot_screer/      s   * **,C#mC	NED<D 
	BGGBIIed7UmU3LLtL88BKKM"D	a47	BD288bS"I&&&DMM"))E"#KK88BKKM"DE	a47	BBHHrc2Y'''DKKLLMM,MM'#Lii-O		BGGBIIel7U3U;GGBIIeog6?LLtL88BKKM"D	a47	BD288bS"I&&&DMM"))E"#KK88BKKM"DE	a47	BBHHrc2Y'''DKKLL%&MM,MM'II|\*I2J    c           	         U R                   u  pgUc<  / n[        U5       H+  n[        US-   U5       H  n	UR                  X/5        M     M-     Uc  [        U5       Vs/ s H  nSU-  PM
     nnUc  [        U5       Vs/ s H  nSU-  PM
     nn/ n
U GH  nUS   nUS   n	[        R                  " SS9nU
R                  U5        UR                  S5      n[        U R                   S   5       H$  n[        R                  " XU4   XU	4   X.   S	S
9  M&     UR                  U SS2U4   U SS2U	4   S5        UR                  U5        Ub=  X    SXH   S S3nX    SXI   S S3nUR                  U5        UR                  U5        O&UR                  X   5        UR                  X   5        Sn[        R                  " U* U/5      n[        R                  " U* U/5      nUR                  USS/S5        UR                  SS/US5        UR                  SS5        UR                  U5        UR                  U5        UR!                  5         GM     U
$ s  snf s  snf )a`  
Plot factor loadings in 2-d plots

Parameters
----------
loadings : array like
    Each column is a component (or factor)
col_names : a list of strings
    column names of `loadings`
row_names : a list of strings
    row names of `loadings`
loading_pairs : None or a list of tuples
    Specify plots. Each tuple (i, j) represent one figure, i and j is
    the loading number for x-axis and y-axis, respectively. If `None`,
    all combinations of the loadings will be plotted.
percent_variance : array_like
    The percent variance explained by each factor.

Returns
-------
figs : a list of figure handles
Nr   z	factor %dzvar %dr   )   r2   )figsizeo      )fontsizeboz (z.1fz%)g?zk--equaldatalim)shaperangeappendr   r   r   textr   r   r   r   r   r   
set_aspectr   r   r    )loadings	col_names	row_namesloading_pairspercent_variancetitlek_varn_factorijfigsitemr%   r'   kx_stry_strvr(   r*   s                       r.   plot_loadingsrO   L   sL   2 nnOExA1q5*$$aV, + ! .3Ho>o[1_o	>+0<8<aX\<	8DGGjj(C__S!x~~a()AHHXd^Xd^\B0 * 	AA5
U' |nB'7':3&?rBE |nB'7':3&?rBEMM% MM% MM),'MM),'xx!Q xx!Q 
q!fe$
Ae$
gy)
D
D7 8 KA ?8s   I?I)Nfactor)NNNNzFactor patterns)matplotlib.pyplotpyplotr   numpyr   r/   rO    r0   r.   <module>rU      s#     DN 7;7;)@r0   