# Computer modern font in every element of plot (PyPlot)

**URL:** https://discourse.julialang.org/t/computer-modern-font-in-every-element-of-plot-pyplot/71030
**Category:** Visualization
**Tags:** pyplot, fonts
**Created:** [November 5, 2021, 10:25pm UTC](https://discourse.julialang.org/t/computer-modern-font-in-every-element-of-plot-pyplot/71030 "2021-11-05T22:25:08Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [November 6, 2021, 12:59am UTC](https://discourse.julialang.org/t/computer-modern-font-in-every-element-of-plot-pyplot/71030/2 "2021-11-06T00:59:32Z")

</div>

> [@DaveR](#):
>
> ```julia
> x = range(0; stop=2*pi, length=1000); y = sin.(3 * x + 4 * cos.(2 * x))
> plot(x, y, color="red", linewidth=2.0, linestyle="--")
> title(L"\sin(3x + 4\cos(2x))")
> xlabel(L"x")
> ylabel(L"y");
> 
> ```

With the GR backend you can get that with:

```julia
julia> using Plots, LaTeXStrings

julia> default(fontfamily="Computer Modern",framestyle=:box)

julia> plot(x, y, color="red", linewidth=2.0, linestyle=:dash, label=L"y", title=L"\sin(3x + 4\cos(2x))", xlabel=L"x", ylabel="y")

```

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

see: [Nice fonts with Plots, GR and LaTeXStrings](https://discourse.julialang.org/t/nice-fonts-with-plots-gr-and-latexstrings/60037)

---

_[View the full topic](https://discourse.julialang.org/t/computer-modern-font-in-every-element-of-plot-pyplot/71030)._
