# Pyplot labels in scientific vs plain format

**URL:** <https://discourse.julialang.org/t/pyplot-labels-in-scientific-vs-plain-format/14847>\
**Category:** General Usage\
**Created:** [September 12, 2018, 9:16am UTC](https://discourse.julialang.org/t/pyplot-labels-in-scientific-vs-plain-format/14847 "2018-09-12T09:16:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ferran\_Mazzanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ferran_mazzanti/32/7458_2.png) [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Post date:** [September 12, 2018, 9:16am UTC](https://discourse.julialang.org/t/pyplot-labels-in-scientific-vs-plain-format/14847/1 "2018-09-12T09:16:53Z")

</div>

Dear all,  
I’m fighting with pyplot labels in julia. I have to plot in a graph certain quantities that are in value very close to the value 104.6, with small differences in the second, third decimals. The fact is that I get the ugly behaviour of having labels in scientific notation, with a major value of 1.04E2 on the top right corner, and values of 0.00 0.02 0.04 etc on the axis labels. But that interferes with the title of the plot and lokks quite odd. Is there a way to tell the y-axis labels to plot exactly the numbers in plain format, i.e, not scientific one?

Example comes here:

```julia
data = zeros(8,2)
data[:,1] = [8. 16. 32. 64. 128. 256. 512. 1024]
data[:,2] = 104.6 + 0.3*rand(8)

clf(); # clear current plot

fig = figure( figsize=(6,4) );
ax = gca() # Get the handle of the current axis

ax[:ticklabel_format](style="plain",axis="y")

title("AIS - samples of log(Z) with [0,1] units")
xlabel("beta");
ylabel("log(Z)");

x_plot = data[:,1]
y_plot = data[:,2]

scatter(x_plot,y_plot,color="black")

```

and the result

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

Thx for your help,

Ferran.

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [September 12, 2018, 12:43pm UTC](https://discourse.julialang.org/t/pyplot-labels-in-scientific-vs-plain-format/14847/2 "2018-09-12T12:43:20Z")

</div>

I cannot reproduce the problem with the standard installation. Can you show us the versions you are using?

I get 2.2.3 for `PyPlot.version` (which refers to the matplotlib version) and Julia 1.0. And here is how it looks like (for Julia 1.0 you have to broadcast the `+` with `.+`):

![plot](https://global.discourse-cdn.com/julialang/original/3X/4/e/4e48353c80567ac357bb60b1b1895603e7507369.png)

The setting for the “scientific notation offset” is done with `ax[:ticklabel_format](useOffset=false)` btw., but even if I set `useOffset=true`, I don’t get that notation…

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [September 12, 2018, 12:52pm UTC](https://discourse.julialang.org/t/pyplot-labels-in-scientific-vs-plain-format/14847/3 "2018-09-12T12:52:42Z")

</div>

The notation kicks in for bigger numbers.

```
data[:,2] = 10000104.6 .+ 0.3*rand(8)

```

With offset:

```
ax[:ticklabel_format](style="plain",axis="y", useOffset=true)

```

![with_offset](https://global.discourse-cdn.com/julialang/original/3X/b/5/b57d92183a4a69229ca7b179cb50e40394865dc9.png)

Without offset:

```
ax[:ticklabel_format](style="plain",axis="y", useOffset=false)

```

![without_offset](https://global.discourse-cdn.com/julialang/original/3X/0/4/042ea96984daee04a395d31b4a97ba5e3d527b13.png)
