# Plotting graph using edge list

**URL:** <https://discourse.julialang.org/t/plotting-graph-using-edge-list/74541>\
**Category:** Graphs\
**Tags:** graphs\
**Created:** [January 13, 2022, 11:11am UTC](https://discourse.julialang.org/t/plotting-graph-using-edge-list/74541 "2022-01-13T11:11:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![etienne\_dg](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@etienne\_dg](https://discourse.julialang.org/u/etienne_dg)\
**Post date:** [January 13, 2022, 11:57am UTC](https://discourse.julialang.org/t/plotting-graph-using-edge-list/74541/2 "2022-01-13T11:57:09Z")

</div>

You can do something like this :  
`edges_to_label = Dict(Edge(1,3) => "a", Edge(3,2) => "b", Edge(1,2) => "c")`  
`display(gplot(g, nodelabel = 1:3, edgelabel = [edges_to_label[e] for e in edges(g)]))`

`SimpleGraph` only supports a unit range for the index of vertices, if you want to use your own labeling, you should use a MetaGraphs. (You can also have a look at `MetaGraphsNext` which is still experimental but should be more performant)

---

_[View the full topic](https://discourse.julialang.org/t/plotting-graph-using-edge-list/74541)._
