Adjust the decimals in scientific notation with Plots.jl

kraqbi
Tue, 12 Aug 2025 10:05:52 +0000
New to Julia

Hello!
I try to publish my figures so I need to edit them as nicely as possible.
I have trouble adjusting the format of my ylabel.

I would like to keep a scientific notation, but Plots.jl is automatically set to a two digits precision.
I would like to keep it to one (else, it takes too much place in subplots).

For example :

using Plots
x = 0:1:10
plot(x, x*1e-6)

How can I keep the ylabel with a format like 2.5x10^-6 instead of 2.50x10^-6 ?

I guess I should use yformatter, but I could not find a documentation or a tutorial to apply.
(I also take recommendations of backends for publication-grade figures)
Thanks!

9 posts - 2 participants