# How to specify text in Plots? (font family, font size, etc.)

**URL:** <https://discourse.julialang.org/t/how-to-specify-text-in-plots-font-family-font-size-etc/60311>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [April 30, 2021, 1:34pm UTC](https://discourse.julialang.org/t/how-to-specify-text-in-plots-font-family-font-size-etc/60311 "2021-04-30T13:34:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [April 30, 2021, 1:34pm UTC](https://discourse.julialang.org/t/how-to-specify-text-in-plots-font-family-font-size-etc/60311/1 "2021-04-30T13:34:44Z")

</div>

Suppose I have a plot using package `Plots.jl`, and I specify the title:

```julia
plot!(title="My title")

```

How do I modify the font family, font style, font size, etc.? A link to where in the documentation would do.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 30, 2021, 2:06pm UTC](https://discourse.julialang.org/t/how-to-specify-text-in-plots-font-family-font-size-etc/60311/2 "2021-04-30T14:06:43Z")

</div>

```julia
julia> plot(title="Test",titlefont=font(20,"Computer Modern"))

```

Take a look at this as well:

> [@Nice fonts with Plots, GR and LaTeXStrings](https://discourse.julialang.org/t/nice-fonts-with-plots-gr-and-latexstrings/60037):
>
> This not a question, just something that might be helpful to others. With Plots 1.12 and GR0.57.4 (at least), and using these options below, one can get a plot with homogeneous fonts (“Computer Modern”) in every element. using Plots using LaTeXStrings plot\_font = "Computer Modern" default(fontfamily=plot\_font, linewidth=2, framestyle=:box, label=nothing, grid=false) scalefontsizes(1.3) plot(sort(rand(10)),sort(rand(10)),label="Legend") plot!(xlabel=L"\textrm{Standard text}(r…

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [May 3, 2021, 7:00am UTC](https://discourse.julialang.org/t/how-to-specify-text-in-plots-font-family-font-size-etc/60311/3 "2021-05-03T07:00:04Z")

</div>

Very nice tips.

I see from the `attributes` that I can set `titlefont`, `tickfont`, `guidefont`, `colorbar_titlefont`, `legendfont`, `plot_titlefont`.

What about `xlabel`/`xaxis`, `ylabel`/`yaxis`, etc. fonts? What are their keywords?

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 3, 2021, 7:44am UTC](https://discourse.julialang.org/t/how-to-specify-text-in-plots-font-family-font-size-etc/60311/4 "2021-05-03T07:44:29Z")

</div>

For the axes labels use `guidefontsize` for all, and `xguidefontsize`, `yguidefontsize` for the individual axes. More [here](https://docs.juliaplots.org/latest/generated/attributes_axis/).

_NB: the feature of prepending x, y, z, to many of Plots.jl keywords does not seem to be clearly documented_
