Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation uses num_vertices but num_vertices is undefined #168

Closed
BrettKnoss opened this issue May 23, 2022 · 3 comments · Fixed by #169
Closed

Documentation uses num_vertices but num_vertices is undefined #168

BrettKnoss opened this issue May 23, 2022 · 3 comments · Fixed by #169

Comments

@BrettKnoss
Copy link

The documentation for GraphPlots has:

g=graphfamous("karate")
nodelabels=[1:num_vertices(g)]
gplot(g,nodelabels=nodelabels)

but num_vertices and Graphs.num_vertices are undefined. Is this from a different version of Graphs.jl ?

vertices(g) outputs BaseOneTo(34) and nv(g) outputs 34

but gplot(g,nodelabel=[1:34]) outputs:


error(::String)@error.jl:33
var"#gplot#14"(::Vector{UnitRange{Int64}}, ::ColorTypes.RGB{FixedPointNumbers.N0f8}, ::Float64, ::Float64, ::Float64, ::Float64, ::Vector{Any}, ::ColorTypes.RGB{FixedPointNumbers.N0f8}, ::Float64, ::Float64, ::ColorTypes.RGB{FixedPointNumbers.N0f8}, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::ColorTypes.RGB{FixedPointNumbers.N0f8}, ::Nothing, ::Float64, ::Float64, ::Float64, ::String, ::Float64, ::typeof(GraphPlot.gplot), ::Graphs.SimpleGraphs.SimpleGraph{Int64}, ::Vector{Float64}, ::Vector{Float64})@plot.jl:119
#gplot#20@plot.jl:229[inlined]
top-level scope@[Local: 1](http://localhost:1234/edit?id=fbd1b6d8-da52-11ec-1970-c3bff3c36c49#)[inlined]

I can see that the number of nodes should be correct, but I'm not sure where the issue is.

@etiennedeg
Copy link
Member

num_vertices was the old method, now replaced by nv. I don't see exactly where you see this example in the documentation, but there is effectively some occurences of num_vertices and num_edges in the docs.
Passing [1:34] for nodelabel should not work because this is a vector of ranges, you should just pass 1:34 or use gplot(g,nodelabel=vertices(g))

@etiennedeg
Copy link
Member

Tell me if you see another place where you see num_vertices, since I did not found the exact occurrence of your documentation.

@Stfort52
Copy link

Stfort52 commented Jul 12, 2022

hello @etiennedeg,
https://juliagraphs.org/GraphPlot.jl/ still uses num_vertices and other outdated functions.
If this is an issue not for GraphPlot but for juliagraph.github.io, I'm sorry for pointing this out in a wrong place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants