# GraphPlot using logos as nodes

**URL:** https://discourse.julialang.org/t/graphplot-using-logos-as-nodes/17518
**Category:** General Usage
**Tags:** plotting
**Created:** [November 14, 2018, 2:24pm UTC](https://discourse.julialang.org/t/graphplot-using-logos-as-nodes/17518 "2018-11-14T14:24:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)
#### Post date: [November 14, 2018, 2:24pm UTC](https://discourse.julialang.org/t/graphplot-using-logos-as-nodes/17518/1 "2018-11-14T14:24:46Z")

</div>

xref: [Feature Request: possibly to add bitmap node · Issue #74 · JuliaGraphs/GraphPlot.jl · GitHub](https://github.com/JuliaGraphs/GraphPlot.jl/issues/74)

Dear all,  
I would like to generate such a graph:

 ![issue_example](https://global.discourse-cdn.com/julialang/original/3X/2/5/25859e5351cfa073b5f9db0ee17153e6db19dac2.png)

Has anyone else done something similar? Is there ready package for such a plotting?

---

<div class="post-metadata">

### Author: ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)
#### Post date: [November 15, 2018, 1:14am UTC](https://discourse.julialang.org/t/graphplot-using-logos-as-nodes/17518/2 "2018-11-15T01:14:16Z")

</div>

As you mention at the link above, `Compose.jl` has this capability (currently for svg output only). Here I’m just providing a working example:

```julia
using Compose
# read all files in directory
logos = read.("./logos/".*readdir("./logos"))

X = [(0.5, 0.2), (0.2, 0.8), (0.8, 0.8)]
point_array = [[x,y] for (x,y) in zip(X, X[[2,3,1]])]
Z = vcat([[x y] for (x,y) in X]...).-0.075

img = compose(context(),
    (context(), line(point_array), stroke(["red","blue","green"]), linewidth(1.5mm)),
    (context(order=2), bitmap(["image/png"], logos[[3,2,1]], Z[:,1], Z[:,2], [0.15], [0.15]))
)

draw(SVG(5inch,4inch), img)
# draw(SVG("bitmap_logos.svg", 5inch, 4inch), img)

```

![bitmap_logos](https://global.discourse-cdn.com/julialang/original/3X/9/0/90a80c76f3b4099114bee0d8a04e2f163a351ff3.png)

---

<div class="post-metadata">

### Author: ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)
#### Post date: [November 26, 2018, 7:08pm UTC](https://discourse.julialang.org/t/graphplot-using-logos-as-nodes/17518/3 "2018-11-26T19:08:29Z")

</div>

Here is a link to work in progress pull request: [WIP: bitmap nodes by TeroFrondelius · Pull Request #75 · JuliaGraphs/GraphPlot.jl · GitHub](https://github.com/JuliaGraphs/GraphPlot.jl/pull/75). At the moment I haven’t figured out where these horizontal lines under the logos come from:

 ![](https://global.discourse-cdn.com/julialang/original/3X/f/c/fcb98eb2ec41893bd89d084ca14a07fe6e50441c.png)
