Skip to content

Commit

Permalink
draw network dictionary assuming coordinate system has negative y axi…
Browse files Browse the repository at this point in the history
…s (y = y, not y = height - y)
  • Loading branch information
ulfaslak committed Apr 11, 2019
1 parent 7e3b8cd commit b86d383
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions netwulf/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def draw_netwulf(network_properties, fig=None, ax=None, figsize=None):

# filter out node positions for links
width = network_properties['xlim'][1] - network_properties['xlim'][0]
pos = { node['id']: np.array([node['x'], node['y']]) for node in network_properties['nodes'] }
height = network_properties['ylim'][1] - network_properties['ylim'][0]
pos = { node['id']: np.array([node['x'], height - node['y']]) for node in network_properties['nodes'] }

lines = []
linewidths = []
Expand Down Expand Up @@ -175,7 +176,7 @@ def draw_netwulf(network_properties, fig=None, ax=None, figsize=None):
node_colors = []

for node in network_properties['nodes']:
XY.append([node['x'], node['y']])
XY.append([node['x'], height - node['y']])
# size has to be given in points**2
size.append( 2*node['radius'] )
node_colors.append(node['color'])
Expand Down

0 comments on commit b86d383

Please sign in to comment.