• 朝韩将军级会谈时隔11年后在板门店重启 2019-07-23
  • Conférence de presse du Premier ministre chinois 2019-07-09
  • 大观园举办“古琴雅集” 市民感受“古韵端午” 2019-06-30
  • 文脉颂中华——黄河新闻网 2019-06-30
  • 水费欠账竟“穿越”16年?用户质疑:为何没见催缴过? 2019-06-21
  • 买房怎么看风水这个真的实在是太重要了 ——凤凰网房产北京 2019-06-11
  • 6月14日凤凰直通车:茅台再开市场化招聘大门,32个部门要285人葡萄 种植 2019-06-07
  • 习近平为传统文化“代言” 2019-05-27
  • 中巴建交一周年 一系列庆祝活动在巴拿马举行 2019-05-24
  • 招聘启事丨西部网诚聘新媒体编辑记者、实习编辑等人员 2019-05-23
  • A title= href=httpwww.snrtv.comlivech=8 target= 2019-05-23
  • 不止消灭刘海屏 vivo NEX发布会看点汇总 2019-05-22
  • 世相【镜头中的陕西人】 2019-05-20
  • 邓紫棋首任明星制作人 吴亦凡身兼二职 2019-05-20
  • 陶昕然女儿正面照曝光 吃蛋糕萌到爆 2019-05-19
  • 500元 倍投方案 稳赚:

         Force-directed graphs in Lightning


    Setup

    In [1]:
     500元 倍投方案 稳赚 www.gvqn.net import os
    from lightning import Lightning
    
    from numpy import random, asarray, linspace, corrcoef
    from colorsys import hsv_to_rgb
    from sklearn import datasets
    import networkx as nx
    

    Connect to server

    In [2]:
    lgn = Lightning(ipython=True, host='//public.lightning-viz.org')
    
    Lightning initialized
    Connected to server at //public.lightning-viz.org
    


    Random binary network

    A random graph where every node has the same degree, with default styling.
    This and other graph plots take matrices (e.g. adjacency matrices) as inputs.
    We use the networkx library to generate the graph, then get its adjancency matrix.
    Double click on a point to see its neighbors (all should have 3).
    Drag points to try and move the graph, it should remain tight because of the degree structure.

    In [3]:
    n = 100
    G = nx.random_regular_graph(3,n)
    mat = nx.adjacency_matrix(G).todense()
    lgn.force(mat)
    
    Out[3]:


    Random weighted network

    The previous network was binary (all links either 0 or 1). Here the links are weighted, which is reflected in the line widths.

    In [4]:
    G = nx.random_regular_graph(3,100)
    mat = asarray(nx.adjacency_matrix(G).todense()) * (((random.rand(100,100))*5) ** 2)
    lgn.force(mat)
    
    Out[4]:


    Lobster network

    The lobster graph, a backbone with some leaves, is colored here by node ordering.
    We also set all nodes with degree less than 2 to gray.

    In [5]:
    G = nx.random_lobster(60, 0.5, 0.0, seed=44)
    mat = nx.adjacency_matrix(G).todense()
    n = len(G.nodes())
    c = [list(asarray(hsv_to_rgb(float(x) / n , 0.8, 1.0))*255) if y > 1 else [150,150,150] for (x,y) in G.degree_iter()]
    lgn.force(mat, color=c)
    
    Out[5]:


    Coloring by degree

    Here we color points (and also change their size) to indicate their degree.
    Click to confirm bigger points have more connections.

    In [6]:
    G = nx.random_geometric_graph(50, 0.1)
    mat = nx.adjacency_matrix(G).todense()
    g = G.degree().values()
    lgn.force(mat, group=g, size=(asarray(g) + 1.5)*3)
    
    Out[6]:


    Graph of clustering

    Graphs can be a useful way to look at data that doesn't neccessarily come from a graph.
    Here we create a graph from a thresholded correlation matrix on data drawn from a set of clusters.
    The cluster identities are clear in the resulting graph.

    In [7]:
    d, g = datasets.make_blobs(n_features=5, n_samples=50, centers=5, cluster_std=2.0, random_state=100)
    c = corrcoef(d)
    c[c<0.9] = 0
    lgn.force(c, group=g)
    
    Out[7]:
  • 朝韩将军级会谈时隔11年后在板门店重启 2019-07-23
  • Conférence de presse du Premier ministre chinois 2019-07-09
  • 大观园举办“古琴雅集” 市民感受“古韵端午” 2019-06-30
  • 文脉颂中华——黄河新闻网 2019-06-30
  • 水费欠账竟“穿越”16年?用户质疑:为何没见催缴过? 2019-06-21
  • 买房怎么看风水这个真的实在是太重要了 ——凤凰网房产北京 2019-06-11
  • 6月14日凤凰直通车:茅台再开市场化招聘大门,32个部门要285人葡萄 种植 2019-06-07
  • 习近平为传统文化“代言” 2019-05-27
  • 中巴建交一周年 一系列庆祝活动在巴拿马举行 2019-05-24
  • 招聘启事丨西部网诚聘新媒体编辑记者、实习编辑等人员 2019-05-23
  • A title= href=httpwww.snrtv.comlivech=8 target= 2019-05-23
  • 不止消灭刘海屏 vivo NEX发布会看点汇总 2019-05-22
  • 世相【镜头中的陕西人】 2019-05-20
  • 邓紫棋首任明星制作人 吴亦凡身兼二职 2019-05-20
  • 陶昕然女儿正面照曝光 吃蛋糕萌到爆 2019-05-19
  • 湖北十一选五推荐号 大快乐时时彩 我的世界动画片 金矿工援彩金 qq游戏里有二八杠 皇冠体育坑人吗 英超冠军射手榜 2019白小姐旋风 apex英雄新英雄铁 福建体育彩票36选7走势图 疯狂维京海盗注册 纽卡斯尔联队vs水晶宫 极速十一选五技巧走 bbin体育到账慢 福利彩票开奖201940期 中国对俄罗斯篮球比分