JuliaPlots / GraphRecipes.jl

Graph-related recipes to be used with Plots.jl
Other
168 stars 28 forks source link

Graphs #2

Open tbreloff opened 8 years ago

tbreloff commented 8 years ago

Finish up spectral graphs, then tackle tree layouts and directed graphs.

See also: https://github.com/JuliaPlots/Plots.jl/issues/4436

tbreloff commented 8 years ago

Decent progress:

graphplot(A, markersize=20rand(n)+10, marker_z=rand(n), lc=:blues, dim=3)

tmp

tbreloff commented 8 years ago

tmp

tmp

Evizero commented 8 years ago

nice

tbreloff commented 8 years ago

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:

tbreloff commented 8 years ago

Here's another: http://web2-clone.research.att.com/export/sites/att_labs/groups/infovis/res/legacy_papers/DBLP-conf-gd-CarmelHK02.pdf

tbreloff commented 8 years ago

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.437.3177&rep=rep1&type=pdf

tbreloff commented 8 years ago

http://ac.els-cdn.com/S0925772105000313/1-s2.0-S0925772105000313-main.pdf?_tid=d2da40a0-4396-11e6-a5b9-00000aacb360&acdnat=1467822754_24f87632c06119b159157d66890ddd7a

tbreloff commented 8 years ago

See section 2.3 of http://link.springer.com/chapter/10.1007%2F978-3-540-31843-9_25#page-1

tbreloff commented 8 years ago

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

tmp

tbreloff commented 8 years ago

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)

tmp

ChrisRackauckas commented 8 years ago

What about a recipe for LightGraphs.jl? @sbromberger

sbromberger commented 8 years ago

Sure. What do we need to do?

my-little-repository commented 7 years ago

@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.

mkborregaard commented 7 years ago

Yeah, the readme examples on PlotRecipes are broken - I think you've already opened an issue there? Sorry for the confusion.