1

I have a Python application which can spit out a lot of data about points that relate to each other. I'd like to add a feature that would create a visual graph of that data such that a user could mouse over a point or edge on the graph and a little tool-tip window would appear and print out a brief description. I've included a screenshot of sort of what I'd like it to look like.

Output of plot

The colored columns represent points that are of the same category, and the arrows track directional relationships between the nodes.

One might obviously jump to a Python library to implement this feature, but I'm aware that other open-source tools like gnuplot exist and, perhaps, they may support creation of such a graph if given properly formatted data via stdin. I'm perfectly comfortable with that usage as well.

Could someone recommend a software or library that can create a plot like the above that adheres to the following requirements?

  1. Can be used by a Python3 application - either via a Python3 library or through a more 'Unix-y' approach involving pipes.
  2. Any files that need to be downloaded are available on Debian's main repository. If there's a really good library that's only available via pip then feel free to mention it, but preference will be given to something that I can manage with apt.
5
  • Have you tried python-networkx? – homocomputeris Feb 4 '20 at 12:55
  • python-networkx looks really promising. I searched for a while, and there were a ton of libraries, but this one looks quite geared for my case. The only thing I don't explicitly see on their website is a description of how to make a tooltip appear by mousing over one of the points. Do you know if it has that feature? – DeepDeadpool Feb 4 '20 at 17:54
  • It uses matplotlib for graphics, so, I believe, you should have a look at MPL's docs. Also, check out interactive nx_altair, pyvis, and plotly, if you haven't. – homocomputeris Feb 4 '20 at 18:03
  • I just found a book regarding that. "Interactive Applications Using Matplotlib" by Benjamin V Root – DeepDeadpool Feb 4 '20 at 18:09
  • And python-networkx appears to be available in Debian's repos as python3-networkx – DeepDeadpool Feb 4 '20 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.