-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subplots? #22
Comments
Not sure what functionality you're looking for, but you might try "combining" the graphs so that they're effectively disconnected components of a larger graph. That is:
|
@piperod There is no subplot function in GraphPlot. You can do subplots like this: using GraphPlot
using Compose
using LightGraphs
g1 = CompleteGraph(10)
g2 = PathGraph(10)
g3 = barabasi_albert(10,3)
g4 = StarGraph(10)
compose(context(),
(context(0, 0, 0.5, 0.5), gplot(g1)),
(context(0.5, 0, 0.5, 0.5), gplot(g2)),
(context(0, 0.5, 0.5, 0.5), gplot(g3)),
(context(0.5, 0.5, 0.5, 0.5), gplot(g4)))
# add titles
compose(context(),
(context(0, 0, 0.5, 0.05), text(0.5,0,"complete graph",hcenter,vtop)),
(context(0, 0.05, 0.5, 0.45), gplot(g1)),
(context(0.5, 0, 0.5, 0.05), text(0.5,0,"path graph",hcenter,vtop)),
(context(0.5, 0.05, 0.5, 0.45), gplot(g2)),
(context(0, 0.5, 0.5, 0.05), text(0.5,0,"scale-free graph",hcenter,vtop)),
(context(0, 0.55, 0.5, 0.45), gplot(g3)),
(context(0.5, 0.5, 0.5, 0.05), text(0.5,0,"star graph",hcenter,vtop)),
(context(0.5, 0.55, 0.5, 0.45), gplot(g4))) For more information, please refer to Compose.jl |
Hello, Reviving this again; Compose does not support plots generated by plot() function. Is there a way to use Graphplot plot with regular plots in a layout? Thanks! |
Have you tried @afternone 's solution? |
Yes, but compose doesn't support regular plots generated by for example p1 = plot(...) |
Then I believe the answer to your original question is no. You could save your GraphPlot plot to an image file and then try to use it in a subplot in Plots.jl or Makie.jl. |
Thanks nonetheless and thanks for the great package! |
I would like to create a figure with several graphs. Does GraphPlot support anything like subplot?
The text was updated successfully, but these errors were encountered: