Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Graphplot in a loop

$
0
0

I would like to use graphplot in a loop inside a function. But graphplot does not return a value. How can this be done? Here is a MWE that demonstrates that I am not getting a plot.

using Plots, GraphRecipes, LightGraphs

function myPlot()
    g1 = SimpleGraph(10,20)
    g2 = SimpleGraph(10,20)
    graphplot(g1, x=rand(10), y=rand(10))
    graphplot(g2, x=rand(10), y=rand(10))
end

myPlot()

I would like to see the teo plots superimposed. I notice that graphplot! exists, but using that instead of graphplot did not help.If I return current() from the function, I get one of the graphplots. How do I superimpose them? One way is to create a single graph by merging. I would rather not.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images