# Position of edge labels with Python igraph

**URL:** <https://igraph.discourse.group/t/position-of-edge-labels-with-python-igraph/1874>\
**Category:** Uncategorized\
**Created:** [4 October 2024 12:50 UTC](https://igraph.discourse.group/t/position-of-edge-labels-with-python-igraph/1874 "2024-10-04T12:50:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucaCerina](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/lucacerina/32/1110_2.png) [@LucaCerina](https://igraph.discourse.group/u/LucaCerina)\
**Post date:** [4 October 2024 12:50 UTC](https://igraph.discourse.group/t/position-of-edge-labels-with-python-igraph/1874/1 "2024-10-04T12:50:46Z")

</div>

Hello,  
I am trying to create a simple graph visualization of two nodes with directed edges, matplotlib backend. I would like to have the edge labels in the middle of the edge, but at the moment they are printed overlapping the vertexes. See image below  
 ![example](https://global.discourse-cdn.com/free1/uploads/igraph/original/2X/e/ea82ba20a96849d093eae79c022c92c8c2a733ed.png)

Is there an attribute to set for the edge\_label position? I have seen something in the version 0.9.1 but it doesn’t seem available in the latest documentation.

Here the code for reproducibility

```auto
### Reproducibility
# OS windows 11
# Python 3.8.18
# matplotlib 3.7.5
# Pandas 2.0.3
# networkx 3.1
# igraph 0.11.6

from matplotlib import pyplot as plt
import pandas as pd
import networkx as nx
import igraph as ig

if __name__ == " __main__":
    target_vals = [0,1]
    data = pd.DataFrame(index=target_vals, columns=target_vals, data=[[1,2],[3,4]])

    G = nx.from_pandas_adjacency(data, create_using=nx.DiGraph)
    h = ig.Graph.from_networkx(G)

    layout = h.layout_circle()
    _,ax=plt.subplots(2,1)
    ig.plot(h, layout=layout, target=ax[0], vertex_label=target_vals, vertex_size=60, edge_loop_size=50, edge_curved=0.3, edge_label=h.es['weight'])
    ig.plot(h, layout=layout, target=ax[1], vertex_label=target_vals, vertex_size=60, edge_loop_size=50, edge_curved=False, edge_label=h.es['weight'])
    plt.show()

```
