Open tbreloff opened 8 years ago
Decent progress:
graphplot(A, markersize=20rand(n)+10, marker_z=rand(n), lc=:blues, dim=3)
nice
Thinking about tree-based layouts for directed graphs... I'd really prefer that GraphLayouts.jl was the source for layout algorithms, but I worry about the speed at which the dependencies will go away (i.e. Compose and JuMP)
In the meantime, I'd like to get something working in PlotRecipes. Here are some ideas:
See section 2.3 of http://link.springer.com/chapter/10.1007%2F978-3-540-31843-9_25#page-1
This is roughly the "section 2.3" algorithm:
using PlotRecipes; pyplot(size=(300,300))
n = 40
s, d = Plots.unzip(unique([(rand(1:n),rand(1:n)) for i=1:60]))
s = convert(Vector{Int}, s)
d = convert(Vector{Int}, d)
w = ones(length(s));
basex, basey = rand(n), rand(n)
@gif for i=1:100
x, y = PlotRecipes.by_axis_local_stress_graph(s,d,w, x=copy(basex),y=copy(basey),maxiter=i)
graphplot(s,d,w, m=(linspace(20,40,n),:inferno), l=(3,:black), x=x, y=y, series_annotations=map(string,1:n), curves=false)
end
Progress with trees:
using PlotRecipes; gr(size=(500,500))
s = [1,2,2,3,3,2,5,4,7]
d = [2,3,4,5,6,7,6,5,4]
w = ones(length(s))
n = max(maximum(s), maximum(d))
graphplot(s,d,w,func=:tree,series_annotations=map(string,1:n),root=:top)
What about a recipe for LightGraphs.jl? @sbromberger
Sure. What do we need to do?
@tbreloff You should definitely put your last example on the main page of the website. I just spent one hour trying to figure out how to get these nice round labeled vertices and finally ended up here after browsing the documentation, examples and code source.
Yeah, the readme examples on PlotRecipes are broken - I think you've already opened an issue there? Sorry for the confusion.
Finish up spectral graphs, then tackle tree layouts and directed graphs.
See also: https://github.com/JuliaPlots/Plots.jl/issues/4436