Python Forum
Print a Graph (packages)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print a Graph (packages)
#1
Hi,
I have as input a matrix that I have created by collecting sequences together. Not all sequences are equal in length and thus I have appended zeros at the end.

This matrix has to be read row by row
[,1] [,2] [,3] [,4] [,5]
[1,] 95 111 81 0 0
[2,] 15 187 201 0 0
[3,] 120 121 0 0 0
[4,] 187 15 0 0 0
[5,] 188 189 0 0 0
[6,] 7 21 0 0 0
[7,] 108 93 0 0 0
[8,] 1 15 0 0 0
[9,] 99 105 0 0 0
[10,] 96 82 0 0 0
[11,] 90 118 0 0 0

so for example first row says that from state 95 I jump to state 111 and then to 81 and so on.

I would like to plot these transitions as a graph where the nodes are the numbers and the paths between the nodes are their connections.

Do you know python packages that can implement such graphs?

At a second level I would try to generate statistics on the transitions.

Can you please suggest me ways forward?
Regards
Alex
Reply
#2
You can use networkx or igraph for example to visualize the graph.
Also have a look at pyviz http://pyviz.org/index.html for other solutions.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  print out is producing same graph mbrown009 2 1,956 May-31-2021, 12:36 AM
Last Post: mbrown009

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020