Python Forum
How can I make a plot representing connection relationship with python matplotlib?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I make a plot representing connection relationship with python matplotlib?
#1
I want to make a plot composed of of dots and connections lines with matplotlib. (It's not a bar chart or normal line chart with axis)

For example, I have a 5*5 matrix, symmetric about the diagonal:
Connection = np.array([0,0,1,1,1],
                      [0,0,1,0,1],
                      [1,1,0,1,0],
                      [1,0,1,0,0],
                      [1,1,0,0,0]) 
The element represent the connections relationships, if Connection[ i ][ j ] = 0, means no connections between dot i and dot j. If Connection[ i ][ j ] = 1, then there should be a connection line between dot i and j

Since it's a bidirectional relation and the matrix is symmetric , if dot 1 has connection with dot 3, then dot 3 should also has connection with dot 1.

How can I make this kind plots?
Thanks in advance!

I think it's can be solved by networkx
Reply
#2
So, in your example there are 5 dots?
If so, how do you want them arranged - my guess is not in a line...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I don't know what is wrong (Python and SQL connection) shereen 3 326 Apr-01-2024, 08:56 AM
Last Post: Pedroski55
  No Internet connection when running a Python script basil_555 8 578 Mar-11-2024, 11:02 AM
Last Post: snippsat
  Connection LTspice-Python with PyLTSpice bartel90 0 336 Feb-05-2024, 11:46 AM
Last Post: bartel90
  Virtual Env changing mysql connection string in python Fredesetes 0 372 Dec-20-2023, 04:06 PM
Last Post: Fredesetes
  connection python and SQL dawid294 4 653 Dec-12-2023, 08:22 AM
Last Post: Pedroski55
  Networking Issues - Python GUI client and server connection always freezes Veritas_Vos_Liberabit24 0 717 Mar-21-2023, 03:18 AM
Last Post: Veritas_Vos_Liberabit24
  Graphic line plot with matplotlib, text file in pytho khadija 2 1,375 Aug-15-2022, 12:00 PM
Last Post: khadija
  How do I run a program without any relationship to it? Pymon 3 1,271 Apr-05-2022, 12:17 AM
Last Post: Pymon
  How to make x-axis readable with matplotlib Mark17 7 3,909 Mar-01-2022, 04:30 PM
Last Post: DPaul
  plot on the same figure using a for loo with matplotlib drSlump 2 1,707 Oct-13-2021, 07:11 AM
Last Post: drSlump

Forum Jump:

User Panel Messages

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