Label Font, Arrow Pointing to Node Edge, Plots integration
Hi,
This is a sweet package, thanks for your hard work writing it. I had a couple questions/requests about looks,
-
It would be really awesome if the node/edge labels could be LaTeXStrings. The times new roman font for the labels really downgrades the images given that I intend to use these plots for journal figures.
-
Is there a way to make the directed graph arrows point to the surface of nodes? Currently, I see this sloppy behavior where some sizes of nodes overlap with the end of the arrow, and I can't find any kw arg to fix it:

-
This package would be much more desireable if graph plots could be integrated into Plots. Maybe there is a way I don't see from the basic usage, but the only way I seem to be able to put these graphs with other plots in Plots.jl is by saving them as images, which feels gratuitous and rigid. I understand this might be a complex suggestion, but it would make a large difference.
Thanks again!
Great suggestions:
-
This is an issue with Compose.jl, which is used by both GraphPlot.jl and Gadfly.jl: https://github.com/GiovineItalia/Gadfly.jl/issues/1094
-
Agreed, this should be fixed and will require editing the logic in
graphlineandgraphcurveso thatendxandendyaccount for the edge linewidth rather than just thenodesize(https://github.com/JuliaGraphs/GraphPlot.jl/blob/52f4aae03acdc6f7aa705b5c0c8bde420734be59/src/lines.jl#L15) -
Might be possible since Gadfly is a backend of Plots.jl and it is based on Compose.jl, which is what GraphPlot.jl uses. See https://github.com/GiovineItalia/Compose.jl/issues/423
@etiennedeg, I thought I'd continue the discussion in https://github.com/JuliaGraphs/GraphPlot.jl/pull/186#issuecomment-1256167343 here.
I agree with you on the issue of non-square plots causing problems with the scaling (this still happens when we use triangle arrows instead). However, the arrow head problem persists even with square plots:
JuliaGraphs/GraphPlot.jl#master:
using Compose, Graphs, GraphPlot
Compose.set_default_graphic_size(10cm,10cm)
gplot(path_digraph(10),layout=circular_layout)
Makes the plot:

hdavid16/GraphPlot.jl#up:
using Graphs, GaphPlot
gplot(path_digraph(10),layout=circular_layout)
Makes the plot:

Observation:
For square plots, the arrow heads look nicer with triangle arrowheads rather than with angled lines. Since you control the corner of the triangles, you can get a cleaner connection to each vertex. So as long as the plot_size is square (the current default in my PR), the issue here is fixed.
@willsharpless ,
If you are still working with plotting graphs, I recommend you try GraphMakie, which addresses your issues:
- it supports LaTeXStrings without any issue
- directed graph arrow heads work (just use
arrow_shift=:end) - Since GraphMakie is part of the Makie ecosystem, you get all the great features of using Makie.
PR #186 would fix #2, but I don't know if this will ever be merged into this package.