
    Gd                        d Z ddlZddlZddlmZ  ej        ddd          Z	 e
d e	                                D             d	          Z ee          Z ej        d
d          Ze                    dd          Ze                    eddddf                   Ze	                     e
 ej        e	          ed          d                   Z ej        ed          Z ej        eeed            ej        eeed           e                    d           e                                 e                    eddddf                   Ze                     edd           e                    d           e!                    d           e"                    d           e                    eddddf                   Z# e#j$         ej%        ed            e#                    d           e#"                    d           e#!                    d            e&                                  ej'                     dS )!a  
===============
Degree Analysis
===============

This example shows several ways to visualize the distribution of the degree of
nodes with two common techniques: a *degree-rank plot* and a
*degree histogram*.

In this example, a random Graph is generated with 100 nodes. The degree of
each node is determined, and a figure is generated showing three things:
1. The subgraph of connected components
2. The degree-rank plot for the Graph, and
3. The degree histogram
    Nd   g{Gz?i4L )seedc              #       K   | ]	\  }}|V  
d S )N ).0nds      6share/doc/networkx-3.1/examples/drawing/plot_degree.py	<genexpr>r      s&      331!333333    T)reversezDegree of a random graph)   r   )figsize         )keyr   i    )ax	node_sizeg?)r   alphazConnected components of G   zb-o)markerzDegree Rank PlotDegreeRank)return_countszDegree histogramz
# of Nodes)(__doc__networkxnxnumpynpmatplotlib.pyplotpyplotpltgnp_random_graphGsorteddegreedegree_sequencemaxdmaxfigurefigadd_gridspecaxgridadd_subplotax0subgraphconnected_componentslenGccspring_layoutposdraw_networkx_nodesdraw_networkx_edges	set_titleset_axis_offax1plot
set_ylabel
set_xlabelax2baruniquetight_layoutshowr   r   r
   <module>rF      s                 BT111&33

333TBBB
s?cj+V<<<			!Q			oofQqS!!!Vn%%jj//22TJJJ1MNNbs***  sCC2 6 6 6 6  sCCs 3 3 3 3 ) * * *      	oofQRR!Vn%% $s + + +   ! ! ! x    v   	oofQRRVn%% ?$	7	7	7 8 8   ! ! ! x    |          




r   