# Font of annotations?

**URL:** <https://discourse.julialang.org/t/font-of-annotations/14998>\
**Category:** Visualization\
**Created:** [September 15, 2018, 6:25pm UTC](https://discourse.julialang.org/t/font-of-annotations/14998 "2018-09-15T18:25:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [September 15, 2018, 6:25pm UTC](https://discourse.julialang.org/t/font-of-annotations/14998/1 "2018-09-15T18:25:26Z")

</div>

dear Plots wizards—how do I set the font (size) of annotations?

```julia
using Plots
y= 2:20; x=2:20; f(x,y)=x+y;
annotations= [(x[i],y[j],round(f(x[i],y[j]),digits=2)) for i=1:length(x) for j=1:length(y)];
plot( ; annotations= annotations, xlim=[first(x)-1,last(x)+1], ylim=[first(y)-1,last(y)+1] )

```

![annfontsize](https://global.discourse-cdn.com/julialang/original/3X/4/b/4b8d68f1e11e4227b014d02efa33a8db492845e3.png)

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 15, 2018, 6:48pm UTC](https://discourse.julialang.org/t/font-of-annotations/14998/2 "2018-09-15T18:48:57Z")

</div>

I got this from the docs for plots.

[http://docs.juliaplots.org/latest/examples/pyplot/#annotations](http://docs.juliaplots.org/latest/examples/pyplot/#annotations)

I changed the last element of each tuple to be a `Plots.text` object in in the way I wanted it.

```julia
t = [(x[1], x[2], text(x[3], 5) for x in annotations]
plot( ; annotations= t, xlim=[first(x)-1,last(x)+1], ylim=[first(y)-1,last(y)+1])

```

 ![18%20PM](https://global.discourse-cdn.com/julialang/original/3X/0/1/01c754d014fa0bb42c8d23a3f706b03f6057fca9.png)

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [September 15, 2018, 10:00pm UTC](https://discourse.julialang.org/t/font-of-annotations/14998/3 "2018-09-15T22:00:49Z")

</div>

this is interesting. we are using `Plots.jl` and not PyPlots, but the docs were still helpful. I did not realize that I should look there…

---

<div class="post-metadata">

**Author:** ![mroavi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mroavi/32/8804_2.png) [@mroavi](https://discourse.julialang.org/u/mroavi)\
**Post date:** [May 26, 2021, 9:24am UTC](https://discourse.julialang.org/t/font-of-annotations/14998/4 "2021-05-26T09:24:27Z")

</div>

This script is missing a closing parenthesis in the line defining `t`. It should be:

```julia
...
t = [(x[1], x[2], text(x[3], 5)) for x in annotations]
...

```
