# \[ANN\] GraphMakie.jl - Plotting graphs... with Makie!

**URL:** https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734
**Category:** Package Announcements
**Tags:** lightgraphs, makie, graphs
**Created:** [June 29, 2021, 9:13am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734 "2021-06-29T09:13:19Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [June 29, 2021, 9:13am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/1 "2021-06-29T09:13:19Z")

</div>

I’m happy to announce [`GraphMakie.jl`](https://github.com/JuliaPlots/GraphMakie.jl), a graph¹ plotting package on top of Makie!  
Make sure to check out the [docs](http://juliaplots.org/GraphMakie.jl/stable/)!

It currently it supports:

- 2D and 3D network plots
- edge and node labels
- a lot of the cool coloring stuff from Makie
- some prebuilt interactions like dragging of nodes

The node layout is powered by [`NetworkLayout.jl`](https://github.com/JuliaGraphs/NetworkLayout.jl) which got its own big update with an updated interface in the 0.4 release which plays nicely with GraphMakie (and potentially other graph plotting packages). The available layouts can be found in the [docs of `NetworkLayout.jl`](https://juliagraphs.org/NetworkLayout.jl/stable/).  
You can also easily define your own layouts which are based on other packages such as [`LayeredLayouts.jl`](https://github.com/oxinabox/LayeredLayouts.jl) (see [DAG example](http://juliaplots.org/GraphMakie.jl/stable/generated/depgraph/)) or extracting positions from a MetaGraph.

This package is still in an early stage and might break often until the interface settles. Feel free to suggest features and open issues and PRs 🙂

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/b/0/b0fb5a7b7a0e752179e5cdd9e4f93bc885f24216.jpeg) ![grafik](https://global.discourse-cdn.com/julialang/original/3X/4/c/4c7c33bc84c03ada66a37eebd2dcc40a143a540e.jpeg) ![grafik](https://global.discourse-cdn.com/julialang/original/3X/2/3/232a4db064ac809e996c85dcc120df61bd141eca.jpeg) ![grafik](https://global.discourse-cdn.com/julialang/original/3X/a/8/a801238d2bc54d7a02d5b5d04cdc2e30b9991c6b.jpeg)

* * *

¹ the networky kind

---

<div class="post-metadata">

### Author: ![opera\_malenky](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/opera_malenky/32/8213_2.png) [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)
#### Post date: [June 29, 2021, 10:35am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/2 "2021-06-29T10:35:16Z")

</div>

This looks great!

---

<div class="post-metadata">

### Author: ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)
#### Post date: [June 29, 2021, 10:57am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/3 "2021-06-29T10:57:42Z")

</div>

Thanks a lot for this. Great work?

---

<div class="post-metadata">

### Author: ![Libbum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/libbum/32/3935_2.png) [@Libbum](https://discourse.julialang.org/u/Libbum)
#### Post date: [June 29, 2021, 12:59pm UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/4 "2021-06-29T12:59:49Z")

</div>

That stress on a truss example is premium business. Well done!

---

<div class="post-metadata">

### Author: ![rayegun](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rayegun/32/26729_2.png) [@rayegun](https://discourse.julialang.org/u/rayegun)
#### Post date: [July 7, 2021, 5:02am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/5 "2021-07-07T05:02:14Z")

</div>

Does this support adjacency matrix inputs? So it can be used without LightGraphs?

---

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [July 7, 2021, 5:51am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/6 "2021-07-07T05:51:39Z")

</div>

No it has LighGraphs as a dependency and it will be hard to get rid of: Internally I use the ordering of the `edges(g)` iterator of LighGraphs to define the order of the edges (i.e. for the color arguments). I thought that compared to a heavy plot lib one needs anyway the additional LightGraphs dep isn’t to bad.

---

<div class="post-metadata">

### Author: ![pszufe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pszufe/32/23452_2.png) [@pszufe](https://discourse.julialang.org/u/pszufe)
#### Post date: [July 9, 2022, 3:18am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/7 "2022-07-09T03:18:49Z")

</div>

While this library looks great I cannot figure out how to add anything to the graph plot.

Suppose I have:

```julia
g = SimpleWeightedDiGraph(rand(3,3))
fig = graphplot(g)

```

How to add, for an example a rectangle to the plot.  
I tried `using GeometryTypes` and the function `poly!(fig, Rectangle(0,0,0.5,0.5))` but this throws an error.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [July 9, 2022, 7:12am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/8 "2022-07-09T07:12:17Z")

</div>

You should start reading this to get familiar with the basic makie types [Basic Tutorial](https://makie.juliaplots.org/dev/tutorials/basic-tutorial/)

Rectangles are done with Rect from GeometryBasics

---

<div class="post-metadata">

### Author: ![Xing\_Shi\_Cai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xing_shi_cai/32/14128_2.png) [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)
#### Post date: [September 30, 2022, 12:17am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/9 "2022-09-30T00:17:45Z")

</div>

Can we use LaTeX in labels with GraphMakie.jl?

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [September 30, 2022, 3:47am UTC](https://discourse.julialang.org/t/ann-graphmakie-jl-plotting-graphs-with-makie/63734/10 "2022-09-30T03:47:13Z")

</div>

Makie has LaTeX label support via [GitHub - Kolaru/MathTeXEngine.jl: A latex math mode engine in pure Julia.](https://github.com/Kolaru/MathTeXEngine.jl)

have you tried?
