# Julia plots: Labels in scientific notation as in default font

**URL:** https://discourse.julialang.org/t/julia-plots-labels-in-scientific-notation-as-in-default-font/113231
**Category:** General Usage
**Tags:** plotting, gr
**Created:** [April 19, 2024, 11:00am UTC](https://discourse.julialang.org/t/julia-plots-labels-in-scientific-notation-as-in-default-font/113231 "2024-04-19T11:00:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![james](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@james](https://discourse.julialang.org/u/james)
#### Post date: [April 19, 2024, 11:00am UTC](https://discourse.julialang.org/t/julia-plots-labels-in-scientific-notation-as-in-default-font/113231/1 "2024-04-19T11:00:23Z")

</div>

I have a log log plot and want to change the x-axis labels manually as in the code below. Hence, I need to use powers of 10 – however, the only ways I come up with gives different fonts than the default:

 ![Screenshot 2024-04-19 at 11.56.28](https://global.discourse-cdn.com/julialang/original/3X/0/6/0689c60bf73cdc2d4fb8850ce5b250af012f1cc2.png)  
Note that both labels on the x axis have a different font than on the y-axis. The 10^0 is a bit more subtle, but the powers is different and this becomes more noticeable for other powers.  
Many thanks in advance!

Here is the code:

```julia
using Plots
using LaTeXStrings

gr()

# get some random data
myplot = plot(1:40, 1:40, xaxis=:log10, yaxis=:log10, 
            xticks = ([1,2,10],["10⁰",L"$2\times 10^0$","10"]))

plot!(myplot, size=(800,400))

```

---

<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 19, 2024, 11:22am UTC](https://discourse.julialang.org/t/julia-plots-labels-in-scientific-notation-as-in-default-font/113231/2 "2024-04-19T11:22:56Z")

</div>

What I do is usually the opposite:

> **[Figures and LaTeX · JuliaNotes.jl](https://m3g.github.io/JuliaNotes.jl/stable/figures/)**
>
> Documentation for JuliaNotes.jl.

---

<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: [April 19, 2024, 5:27pm UTC](https://discourse.julialang.org/t/julia-plots-labels-in-scientific-notation-as-in-default-font/113231/3 "2024-04-19T17:27:32Z")

</div>

Try also the `pgfplotsx()` backend:

```julia
using LaTeXStrings, Plots; pgfplotsx()
p = plot(1:40, 1:40, axis=:log10, xticks=([1,2,10],[L"10^0",L"$2\times 10^0$","10"]));
plot!(p, size=(800,400))

```

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