# Basic plot function in NetworkLayout.jl not working

**URL:** <https://discourse.julialang.org/t/basic-plot-function-in-networklayout-jl-not-working/73515>\
**Category:** General Usage\
**Created:** [December 23, 2021, 3:29am UTC](https://discourse.julialang.org/t/basic-plot-function-in-networklayout-jl-not-working/73515 "2021-12-23T03:29:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Post date:** [December 23, 2021, 3:29am UTC](https://discourse.julialang.org/t/basic-plot-function-in-networklayout-jl-not-working/73515/1 "2021-12-23T03:29:03Z")

</div>

I am having trouble executing even the most basic commands in the NetworkLayout package. The following code is **verbatim** from the package’s [documentation](https://juliagraphs.org/NetworkLayout.jl/stable/) page.

```julia
using CairoMakie
using NetworkLayout
using GraphMakie, LightGraphs
adj_matrix = [0 1 1 0 0 0 0 0 0 0;
              0 0 0 0 1 1 0 0 0 0;
              0 0 0 1 0 0 1 0 1 0;
              0 0 0 0 0 0 0 0 0 0;
              0 0 0 0 0 0 0 1 0 1;
              0 0 0 0 0 0 0 0 0 0;
              0 0 0 0 0 0 0 0 0 0;
              0 0 0 0 0 0 0 0 0 0;
              0 0 0 0 0 0 0 0 0 0;
              0 0 0 0 0 0 0 0 0 0]
g = SimpleDiGraph(adj_matrix)
layout = Buchheim()
f, ax, p = graphplot(g, layout=layout)

```

Leads to the error message :

```julia
ERROR: MethodError: no method matching ne(::SimpleDiGraph{Int64})
Closest candidates are:
  ne(::Graphs.SimpleGraphs.AbstractSimpleGraph) at ~/.julia/packages/Graphs/Mih78/src/SimpleGraphs/SimpleGraphs.jl:118
  ne(::Graphs.AbstractGraph) at ~/.julia/packages/Graphs/Mih78/src/interface.jl:158
Stacktrace:
  [1] find_edge_paths(g::SimpleDiGraph{Int64}, attr::Attributes, pos::Vector{Point{2, Float32}})
    @ GraphMakie ~/.julia/packages/GraphMakie/tEQ8U/src/recipes.jl:307
  [2] (::GraphMakie.var"#19#36"{Combined{GraphMakie.graphplot, Tuple{SimpleDiGraph{Int64}}}, Observable{SimpleDiGraph{Int64}}})(pos::Vector{Point{2, Float32}}, s::MakieCore.Automatic, d::MakieCore.Automatic, w::MakieCore.Automatic)
    @ GraphMakie ~/.julia/packages/GraphMakie/tEQ8U/src/recipes.jl:162
  [3] lift(::Function, ::Observable{Any}, ::Observable{Any}, ::Vararg{Observable{Any}}; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/interaction/nodes.jl:13
  [4] lift(::Function, ::Observable{Any}, ::Observable{Any}, ::Observable{Any}, ::Vararg{Observable{Any}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/interaction/nodes.jl:10
  [5] plot!(gp::Combined{GraphMakie.graphplot, Tuple{SimpleDiGraph{Int64}}})
    @ GraphMakie ~/.julia/packages/GraphMakie/tEQ8U/src/recipes.jl:160
  [6] plot!(scene::Scene, P::Type{Combined{GraphMakie.graphplot, Tuple{SimpleDiGraph{Int64}}}}, attributes::Attributes, input::Tuple{Observable{SimpleDiGraph{Int64}}}, args::Observable{Tuple{SimpleDiGraph{Int64}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/interfaces.jl:428
  [7] plot!(scene::Scene, P::Type{Combined{GraphMakie.graphplot}}, attributes::Attributes, args::SimpleDiGraph{Int64}; kw_attributes::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:show_axis,), Tuple{Bool}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/interfaces.jl:339
  [8] plot(P::Type{Combined{GraphMakie.graphplot}}, args::SimpleDiGraph{Int64}; axis::NamedTuple{(), Tuple{}}, figure::NamedTuple{(), Tuple{}}, kw_attributes::Base.Pairs{Symbol, Buchheim{Float64, Float64}, Tuple{Symbol}, NamedTuple{(:layout,), Tuple{Buchheim{Float64, Float64}}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/figureplotting.jl:28
  [9] graphplot(args::SimpleDiGraph{Int64}; attributes::Base.Pairs{Symbol, Buchheim{Float64, Float64}, Tuple{Symbol}, NamedTuple{(:layout,), Tuple{Buchheim{Float64, Float64}}}})
    @ GraphMakie ~/.julia/packages/MakieCore/S8PkO/src/recipes.jl:31
 [10] top-level scope
    @ REPL[72]:1

```

Am I missing something ? I have Julia version **1.7.0**. It seems to me that the package does not work for advanced versions of Julia.

---

<div class="post-metadata">

**Author:** ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Post date:** [December 23, 2021, 7:57am UTC](https://discourse.julialang.org/t/basic-plot-function-in-networklayout-jl-not-working/73515/2 "2021-12-23T07:57:15Z")

</div>

This is probably due to the LightGraphs to Graphs transition. NetworkLayout supports both, newer versions of GraphMakie only Graphs. Please try with Graphs instead of LightGraphs!
