0

I am having this issue with graph-tool where the longer of my labels are cropped from the end figure.

I am using gt.graph_draw() for plotting and have tried changing its arguments to get better results.

  • Even if I increase output_size, the graph will just be stretched out, so that my labels are still cropped away
  • fit_view was already True, changing it to Flase just messed everything up

I have tried making my labels shorter (begrudgingly) but that again, just leads to the graph being stretched so that some of them still get cropped.

Any Ideas what I can do? Maybe I can somehow sort this out on the matplotlib side of things?

TheChymera
  • 17,004
  • 14
  • 56
  • 86
  • Can you post an output? – Peaceful Dec 02 '16 at 16:38
  • you mean a png? why would that make a difference? it's just a circle of nodes with some of the longer text extending beyond where the image ends. – TheChymera Dec 02 '16 at 17:12
  • Then can you post a link to an example data? I will try to make the same picture. I think graph-tool does adjust figure to make everything fit the view. – Peaceful Dec 03 '16 at 05:09

1 Answers1

0

I ran into the same problem with gt.draw.graph_draw() not handling labels and overlaps well. Even with a lot of fiddling, the problems never totally vanished.

As an alternative, albeit having a different look: try using gt.draw.graphviz_draw(), which handles a few parameters differently but is more capable in regard to collision handling and layout and works better with labels (even of different length).
The main parameters to play with would be ratio and overlap; sep might also be useful. They do not only apply to collisions between nodes, but also to the borders of the output area.

blsqr
  • 75
  • 1
  • 6