Calling graph_draw() with a graph containing no edges will raise "Value Error" exception
To reproduce this issue, please execute the Python script attached to this issue report.
no_edge.py
Command line dump:
ubuntu@ubuntu-VirtualBox:~/Desktop/Jie$ python ./no_edge.py
Traceback (most recent call last):
File "./no_edge.py", line 7, in <module>
graph_draw(g, output="./nodes-only.png")
File "/usr/lib/python2.7/dist-packages/graph_tool/draw/cairo_draw.py", line 1134, in graph_draw
pad, cr)
File "/usr/lib/python2.7/dist-packages/graph_tool/draw/cairo_draw.py", line 1308, in fit_to_view
font_size, cr)
File "/usr/lib/python2.7/dist-packages/graph_tool/draw/cairo_draw.py", line 1277, in get_bb
slm = sl.fa.max() * 0.75
File "/usr/lib/python2.7/dist-packages/numpy/core/_methods.py", line 17, in _amax
out=out, keepdims=keepdims)
ValueError: zero-size array to reduction operation maximum which has no identity
ubuntu@ubuntu-VirtualBox:~/Desktop/Jie$
This issue seems to have similarity to the closed issue #161 (closed)