# GraphPlot.jl: possible to change font family?

**URL:** <https://discourse.julialang.org/t/graphplot-jl-possible-to-change-font-family/36699>\
**Category:** Visualization\
**Created:** [March 29, 2020, 8:26pm UTC](https://discourse.julialang.org/t/graphplot-jl-possible-to-change-font-family/36699 "2020-03-29T20:26:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor\_Douven](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/igor_douven/32/8433_2.png) [@Igor\_Douven](https://discourse.julialang.org/u/Igor_Douven)\
**Post date:** [March 29, 2020, 8:27pm UTC](https://discourse.julialang.org/t/graphplot-jl-possible-to-change-font-family/36699/1 "2020-03-29T20:27:00Z")

</div>

I’m using `gplot()` from the `GraphPlot.jl` package to plot a graph created with `LightGraphs.jl`. I’d like to change the font family used for the node labels, but can’t find in the documentation how to do that. Does anyone know?

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [March 30, 2020, 11:55am UTC](https://discourse.julialang.org/t/graphplot-jl-possible-to-change-font-family/36699/2 "2020-03-30T11:55:21Z")

</div>

Creating a PlotText object with `text` should work, e.g. something like `names = [text("Times", 12, name) for name in labels]`  
[https://docs.juliaplots.org/latest/generated/gr/#gr-ref20-1](https://docs.juliaplots.org/latest/generated/gr/#gr-ref20-1)

---

<div class="post-metadata">

**Author:** ![Igor\_Douven](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/igor_douven/32/8433_2.png) [@Igor\_Douven](https://discourse.julialang.org/u/Igor_Douven)\
**Post date:** [March 30, 2020, 12:45pm UTC](https://discourse.julialang.org/t/graphplot-jl-possible-to-change-font-family/36699/3 "2020-03-30T12:45:44Z")

</div>

Thanks. Maybe I’m doing something, but I can’t get this to work. Here is a MWE:

```julia
using LightGraphs, GraphPlot, Compose

m = reshape(Int.(rand(Bool, 100)), (10, 10))
g = SimpleDiGraph(m)
labels = 1:10
names = [text("Open Sans", 12, name) for name in labels]
gplot(g, nodelabel=names)

```

This doesn’t give an error, but the labels in the resulting plot are not numbers but rather the whole text of the `Compose` objects.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [March 30, 2020, 1:04pm UTC](https://discourse.julialang.org/t/graphplot-jl-possible-to-change-font-family/36699/4 "2020-03-30T13:04:28Z")

</div>

I’m sorry please ignore my post. I thought you used GraphRecipes.jl.
