6

I have a simple graph with a lot of points, so I don't want to show labels for all of them. But I do want to be able to tell which is which, via tooltips.

Is it possible to add/show tooltips using networkx?

Here's my code:

import networkx as nx
g = nx.Graph()
g.add_node(1, label="descriptive label")
nx.draw(g)

I'd like "descriptive label" to show up as a tooltip. Any ideas?

Jason Sundram
  • 12,225
  • 19
  • 71
  • 86

1 Answers1

3

NetworkX does not have this built in, NetworkX uses matplotlib underneath so you could try the suggestion here:

Point and line tooltips in matplotlib?

and adapt it to your code, hope this helps.

Community
  • 1
  • 1
EdChum
  • 376,765
  • 198
  • 813
  • 562