o
    ˷e                     @   s  d Z ddlZddlZddlmZ ejddddZ	e
dd e	 D d	d
ZeeZejdddZeddZeeddddf Ze	e
ee	ed	dd ZejeddZejeeedd ejeeedd ed e  eeddddf Zej eddd ed e!d e"d eeddddf Z#e#j$ej%ed	d  e#d  e#"d e#!d! e&  e'  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                 c   s    | ]\}}|V  qd S )N ).0ndr   r   u/var/www/ideatree/venv/lib/python3.10/site-packages/../../../share/doc/networkx-2.8.6/examples/drawing/plot_degree.py	<genexpr>   s    r	   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   r   <module>   s8    






