# Problems plotting a simple graph

**URL:** https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533
**Category:** General Usage
**Created:** [December 3, 2021, 4:34pm UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533 "2021-12-03T16:34:57Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_Williams](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mark_williams/32/7668_2.png) [@Mark\_Williams](https://discourse.julialang.org/u/Mark_Williams)
#### Post date: [December 3, 2021, 4:34pm UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533/1 "2021-12-03T16:34:57Z")

</div>

For some reason I can’t produce a plot of a graph from LightGraphs.jl using GraphPlot.jl. I’m quite new to Julia so not sure what else to try.

```julia
using LightGraphs
using GraphPlot

sg = complete_digraph(3)
gplot(sg)

```

I just receive a method error

```julia
MethodError: no method matching spring_layout(::SimpleDiGraph{Int64})

```

If someone could point me in the right direction for a solution I would be very grateful.

---

<div class="post-metadata">

### Author: ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)
#### Post date: [December 3, 2021, 4:43pm UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533/2 "2021-12-03T16:43:19Z")

</div>

Recently, LightGraphs.jl moved to [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl).  
Perhaps that has something to do with this error (didn’t have a chance to test right now)?  
I would suggest `using Graphs` in place of `using LightGraphs` to see if this works easily.

---

<div class="post-metadata">

### Author: ![Mark\_Williams](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mark_williams/32/7668_2.png) [@Mark\_Williams](https://discourse.julialang.org/u/Mark_Williams)
#### Post date: [December 3, 2021, 4:59pm UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533/3 "2021-12-03T16:59:20Z")

</div>

The package Graphs.jl doesn’t seem to work at all.

```julia
using Graphs

g = simple_graph(3)

```

Just returns (same with other graph generators )

```julia
UndefVarError: simple_graph not defined

```

---

<div class="post-metadata">

### Author: ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)
#### Post date: [December 3, 2021, 5:16pm UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533/4 "2021-12-03T17:16:44Z")

</div>

I think it’s this:

```julia
using Graphs

g = SimpleGraph(3)

```

---

<div class="post-metadata">

### Author: ![Temi-Tory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/temi-tory/32/29716_2.png) [@Temi-Tory](https://discourse.julialang.org/u/Temi-Tory)
#### Post date: [April 25, 2022, 7:16pm UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533/5 "2022-04-25T19:16:17Z")

</div>

Did you manage to resolve this @Mark_Williams ?  
I am stuck with the same issue now

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 17, 2022, 6:38am UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533/6 "2022-07-17T06:38:55Z")

</div>

@Temi-Tory  
yes you just change the LightGraphs into Graphs and it will work. I try OpenStreetMapX.jl that uses LightGraphs and using Graphs will work
