Skip to content

Commit 0e53be6

Browse files
juliohmsbromberger
authored andcommitted
Allow edge label offset for undirected graphs (#46)
1 parent ed6db20 commit 0e53be6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ function gplot{T<:Real}(G,
184184
j = _dst_index(e, G)
185185
mid_x = (locs_x[i]+locs_x[j])/2.0
186186
mid_y = (locs_y[i]+locs_y[j])/2.0
187-
edge_locs_x[e_idx] = _is_directed(G) ? (mid_x+locs_x[j])/2.0 : mid_x + edgelabeldistx*NODESIZE
188-
edge_locs_y[e_idx] = _is_directed(G) ? (mid_y+locs_y[j])/2.0 : mid_y + edgelabeldisty*NODESIZE
187+
edge_locs_x[e_idx] = (_is_directed(G) ? (mid_x+locs_x[j])/2.0 : mid_x) + edgelabeldistx*NODESIZE
188+
edge_locs_y[e_idx] = (_is_directed(G) ? (mid_y+locs_y[j])/2.0 : mid_y) + edgelabeldisty*NODESIZE
189189
end
190190
edgetexts = text(edge_locs_x, edge_locs_y, map(string, edgelabel), [hcenter], [vcenter])
191191
end

0 commit comments

Comments
 (0)