# Networkx plot: Make edges stay out of the nodes

I want to plot a directional network graph using networkx in python. When using an alpha value different from 1 the beginnings of the edges are drawn also inside the nodes; the arrows are fine however.

How can I make the edges stay out of my nodes?

I didn't find anything about it in the documentation. Setting alpha=1 would obviously solve it, but that is not what I want.

``````import math
import pandas as pd
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt

pos={"x":(1/2, math.sqrt(3/4)), "y":(0,0), "z":(1,0)}

G=nx.DiGraph()
nx.draw(G, pos=pos, with_labels=True, node_size=1500, alpha=0.3, arrows=True,
arrowsize=20, width=2)
plt.show()
``````

This is what comes out. The edges continue into the "x" node, which is bad.

On Best Solutions

You can solve this by drawing the nodes multiple times:

``````import math
import networkx as nx
import matplotlib.pyplot as plt

pos={"x":(1/2, math.sqrt(3/4)), "y":(0,0), "z":(1,0)}

G=nx.DiGraph()
nx.draw_networkx_edges(G, pos=pos, with_labels=True, node_size=1500, alpha=0.3, arrows=True,
arrowsize=20, width=2)
# draw white circles over the lines
nx.draw_networkx_nodes(G, pos=pos, with_labels=True, node_size=1500, alpha=1, arrows=True,
arrowsize=20, width=2, node_color='w')
# draw the nodes as desired
nx.draw_networkx_nodes(G, pos=pos, node_size=1500, alpha=.3, arrows=True,
arrowsize=20, width=2)
nx.draw_networkx_labels(G, pos=pos)