shahinrostami / plotapi

Engaging visualisations, made easy.
https://plotapi.com
MIT License
267 stars 17 forks source link

Connections and labels doesn't show #25

Closed gaardhus closed 3 years ago

gaardhus commented 3 years ago

I'm trying to plot a Chord diagram of some network relations. I've created a matrix and list of names as in the tutorial, however to plot doesn't show labels or connections. It works for another network.

I'm working in JupyterLab

matrix = [[0, 51, 130, 6, 67, 34, 73, 34, 0, 0, 23, 0, 25, 1, 99, 8, 48, 120, 5, 17, 0, 4, 0, 0, 0, 0, 0], 
[35, 0, 33, 2, 27, 5, 15, 30, 0, 0, 20, 2, 2, 13, 35, 12, 22, 8, 4, 0, 0, 2, 1, 0, 0, 0, 1], 
[118, 32, 0, 17, 42, 18, 73, 34, 0, 0, 62, 6, 17, 11, 61, 5, 27, 90, 11, 6, 0, 5, 0, 0, 0, 0, 0], 
[10, 2, 11, 0, 3, 1, 17, 5, 0, 0, 8, 0, 4, 1, 14, 2, 0, 15, 2, 0, 0, 2, 0, 0, 0, 0, 1], 
[57, 41, 38, 2, 0, 19, 7, 6, 0, 0, 34, 0, 5, 0, 32, 17, 22, 11, 1, 0, 0, 3, 0, 0, 0, 0, 0], 
[20, 4, 9, 0, 6, 0, 2, 3, 0, 0, 8, 0, 5, 0, 8, 6, 1, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0], 
[45, 3, 41, 14, 3, 4, 0, 7, 0, 0, 20, 3, 6, 0, 18, 0, 8, 37, 1, 8, 0, 2, 0, 0, 0, 0, 0], 
[25, 18, 14, 2, 3, 6, 9, 0, 0, 0, 16, 2, 2, 15, 21, 4, 6, 13, 6, 1, 0, 1, 0, 0, 0, 0, 1], 
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
[12, 24, 47, 3, 17, 19,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
[0, 5, 0, 1, 0, 0, 0, 5, 0, 0, 3, 1, 0, 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

names = ['Skatter og afgifter', 'Udlændinge, flygtninge og integration', 'Erhverv', 'Trafik og transport', 'Arbejdsmarked', 'Ejendomme og byggeri', 'Miljø', 'Politi', 'Dagtilbud', 'Kirke', 'Sundhed', 'Kultur', 'Bolig- og bygningsforhold', 'Retspleje og domstole', 'Samfundsstruktur', 'Social og omsorg', 'Uddannelse og undervisning', 'Energi- og vandforsyning', 'Forsvar', 'Natur og klima', 'Fritid og idræt', 'Fysisk planlægning og geodata', 'Udenrigstjeneste', 'Samfundsøkonomi og statistik', 'Myndighedens it', 'Borgerskab', 'Straffuldbyrdelse']

Chord(list_matrix, names).show()

image