Skip to content
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

[feature request] allow user to adjust edge stroke styles by passing a vector as a kwarg #155

Open
SimonEnsemble opened this issue Sep 7, 2021 · 2 comments

Comments

@SimonEnsemble
Copy link

would be cool to be able to change the edge strokes as dashed, dotted, etc. to denote different classes of edges.
e.g. I want to illustrate that there is not a path between v_1 and v_3. would be cool to be able to connect v_1 and v_3 with a dashed edge line.
(I know you can adjust edge colors, but edge stroke would be great too.)

image

@hdavid16
Copy link
Contributor

This will get fixed in: #176

@hdavid16
Copy link
Contributor

hdavid16 commented Apr 3, 2023

@SimonEnsemble ,
Since PR #176 hasn't been reviewed. You can accomplish this with GraphMakie:

using Graphs, GraphMakie, GLMakie, LaTeXStrings

g=SimpleGraph(Edge.([(1,2),(1,3),(3,4),(3,5),(4,5)]))

graphplot(g,
    node_size=40,
    node_color=:white,
    node_attr=(strokecolor=:black, strokewidth=5),
    nlabels=[L"v_%$i" for i in vertices(g)], #use latex for labels
    nlabels_align=(:center,:center),
    edge_attr=(linestyle=[e==Edge(1,3) ? :dash : :solid for e in edges(g)],), #set dashed edge for 1-3 edge
    edge_plottype=:beziersegments #lets you set edge specific properties
)

You'll get the following plot:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants