I observe a strange behavior when plotting graphs with GraphPlot. In most cases it refuses to plot the input graph if I call gplot() via a function. However, sometimes (in rare cases) it works. Calling gplot() from the global scope works fine. Here is a minimal example:
using LightGraphs using GraphPlot function myPlotFunction( g::SimpleDiGraph ) gplot( g ) return nothing end g = SimpleDiGraph( 5 ) add_edge!(g, 1, 2) add_edge!(g, 3, 4) # THIS DOES NOT PLOT myPlotFunction( g ) # THIS PLOTS AS EXPECTED gplot( g )
Do you have any suggestions how to fix that? Does anyone else observe this? I am on Ubuntu 18.04, Julia 1.1.0.
Thanks in advance.