I want to generate a long hierarchy chart of number, but the chart coming out is pixelated and cannot be zoomed to reveal its details. I'm using networkx and matplotlib to generate this chart. This is the array that I want to generate hierarchy of.
tree = [(1, 2), (2, 4), (4, 8), (8, 16), (16, 5), (5, 10), (10, 3), (3, 6), (10, 20), (20, 40), (40, 13), (13, 26), (26, 52), (52, 17), (17, 34), (34, 11), (11, 22), (22, 7), (7, 14), (14, 28), (28, 9), (6, 12), (40, 80), (80, 160), (160, 53), (53, 106), (106, 35), (35, 70), (70, 23), (23, 46), (46, 15), (9, 18), (22, 44), (44, 88), (88, 29), (29, 58), (58, 19), (16, 32), (32, 64), (64, 21), (12, 24), (19, 38), (38, 76), (76, 25), (46, 92), (92, 184), (184, 61), (61, 122), (122, 244), (244, 488), (488, 976), (976, 325), (325, 650), (650, 1300), (1300, 433), (433, 866), (866, 1732), (1732, 577), (577, 1154), (1154, 2308), (2308, 4616), (4616, 9232), (9232, 3077), (3077, 6154), (6154, 2051), (2051, 4102), (4102, 1367), (1367, 2734), (2734, 911), (911, 1822), (1822, 3644), (3644, 7288), (7288, 2429), (2429, 4858), (4858, 1619), (1619, 3238), (3238, 1079), (1079, 2158), (2158, 719), (719, 1438), (1438, 479), (479, 958), (958, 319), (319, 638), (638, 1276), (1276, 425), (425, 850), (850, 283), (283, 566), (566, 1132), (1132, 377), (377, 754), (754, 251), (251, 502), (502, 167), (167, 334), (334, 668), (668, 1336), (1336, 445), (445, 890), (890, 1780), (1780, 593), (593, 1186), (1186, 395), (395, 790), (790, 263), (263, 526), (526, 175), (175, 350), (350, 700), (700, 233), (233, 466), (466, 155), (155, 310), (310, 103), (103, 206), (206, 412), (412, 137), (137, 274), (274, 91), (91, 182), (182, 364), (364, 121), (121, 242), (242, 484), (484, 161), (161, 322), (322, 107), (107, 214), (214, 71), (71, 142), (142, 47), (47, 94), (94, 31), (31, 62), (62, 124), (124, 41), (41, 82), (82, 27), (15, 30), (25, 50), (50, 100), (100, 33)]
graph is generated as follows:
G=nx.Graph()
G.add_edges_from(tree)
pos = tg.hierarchy_pos(G,1)
nx.draw(G, pos=pos, with_labels=True)
The resulting hierarchy looks like this:enter image description here As seen, the graph is a pixelated image and cannot be zoomed to reveal the details. How can I generate a vectorized version of this graph.
The hierarchy_pos function is taken from Can one get hierarchical graphs from networkx with python 3?