wiheto / netplotbrain

A package to create simple 3D network visualizations on a brain.
Apache License 2.0
69 stars 7 forks source link

BUG: 2 column plot error leads to an error #17

Closed wiheto closed 2 years ago

wiheto commented 3 years ago

The following minimal example

import netplotbrain
netplotbrain.plot(nodes=None,
                  edges=None,
                  template=None,
                  view=['SS'])

results in the following error:

~/packages/netplotbrain/netplotbrain/plot.py in plot(nodes, fig, ax, view, frames, edges, template, templatestyle, templatevoxsize, arrowaxis, arroworigin, edgecolor, nodesize, nodecolor, nodetype, nodecolorby, nodecmap, edgeweights, nodecols, nodeimg, hemisphere, title, highlightnodes, showlegend, **kwargs)
    244     for ri in range(nrows):
    245         # Get the azim, elev and arrowaxis for each row
--> 246         azim, elev, arrowaxis_row = _get_view(
    247             view[ri], frames, arrowaxis=arrowaxis)
    248         for fi in range(frames):

~/packages/netplotbrain/netplotbrain/utils/plot_utils.py in _get_view(views, frames, arrowaxis)
     78         for n in range(frames):
     79             if direction == '+':
---> 80                 vx.append(v1x + n * ((v2x - v1x) / (frames - 1)))
     81                 vy.append(v1y + n * ((v2y - v1y) / (frames - 1)))
     82             elif direction == '-':

ZeroDivisionError: division by zero