Closed lucasmsoares96 closed 2 years ago
When trying to plot a graph like the one below, nothing is plotted.
using GraphPlot using Graphs using SimpleWeightedGraphs graph = [ 00 01 05 07 09 00 01 00 06 04 03 00 05 06 00 05 00 10 07 04 05 00 08 03 09 03 00 08 00 00 00 00 10 03 00 00 ] w = SimpleWeightedGraph(graph) arestas = edges(w) pesos = [p.weight for p ∈ arestas] gplot(w, edgelabel=pesos, nodelabel=1:nv(w), edgelabeldistx=0.5, edgelabeldisty=0.5) println("")
But I put the command print("") before the gplot it works fine.
arestas = edges(w) pesos = [p.weight for p ∈ arestas] println("") gplot(w, edgelabel=pesos, nodelabel=1:nv(w), edgelabeldistx=0.5, edgelabeldisty=0.5)
Very likely, that's because the display system only picks up the last value returned. try an explicit display(gplot(...)) if you want other lines after the plotting command.
display(gplot(...))
Worked perfectly! Thank you!
When trying to plot a graph like the one below, nothing is plotted.
But I put the command print("") before the gplot it works fine.