The repository formerly known as PlotRecipes
This repo maintains a collection of recipes for graph analysis, and is a reduced and refactored version of the previous PlotRecipes. It uses the powerful machinery of Plots and RecipesBase to turn simple transformations into flexible visualizations.
using GraphRecipes
using Plots
const n = 15
const A = Float64[ rand() < 0.5 ? 0 : rand() for i=1:n, j=1:n]
for i=1:n
A[i, 1:i-1] = A[1:i-1, i]
end
graphplot(A,
node_weights = 1:n,
nodecolor = range(colorant"yellow", stop=colorant"red", length=n),
names = 1:n,
linecolor = :darkgrey,
)
Now plot the graph in three dimensions.
graphplot(A,
node_weights = 1:n,
markercolor = :darkgray,
dim = 3,
markersize = 5,
linecolor = :darkgrey,
linealpha = 0.5
)
using LinearAlgebra
using SparseArrays
using GraphRecipes
using Plots
adjmat = Symmetric(sparse(rand(0:1,8,8)))
plot(
graphplot(adjmat,
method=:chorddiagram,
names=[text(string(i), 8) for i in 1:8],
linecolor=:black,
fillcolor=:lightgray),
graphplot(adjmat,
method=:arcdiagram,
markersize=3,
linecolor=:black,
markercolor=:black)
)
using GraphRecipes
using Plots
default(size=(1000, 1000))
code = :(
function mysum(list)
out = 0
for value in list
out += value
end
out
end
)
plot(code, fontsize=12, shorten=0.01, axis_buffer=0.15, nodeshape=:rect)
using GraphRecipes
using Plots
default(size=(1000, 1000))
plot(AbstractFloat, method=:tree, fontsize=10, nodeshape=:ellipse)




