# GLMakie, yscale=log10 and Float32

**URL:** <https://discourse.julialang.org/t/glmakie-yscale-log10-and-float32/101731>\
**Category:** Visualization\
**Tags:** glmakie\
**Created:** [July 18, 2023, 12:59pm UTC](https://discourse.julialang.org/t/glmakie-yscale-log10-and-float32/101731 "2023-07-18T12:59:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tt1234567](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Post date:** [July 18, 2023, 12:59pm UTC](https://discourse.julialang.org/t/glmakie-yscale-log10-and-float32/101731/1 "2023-07-18T12:59:37Z")

</div>

A simple scatter plot with a log scale gives an error if the y values underflow Float32:

```julia
x = 10.0.^-(0:50)
using GLMakie
fig = Figure()
ax = Axis(fig[1,1], yscale=log10)
scatter!(x)

ERROR: Found invalid y-limits (0.0f0, 1.0f0) for scale log10 which is defined on the interval 0.0..Inf (open)
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
    ...

```

On the other hand, the following seems fine:

```julia
scatter(x)

```

I (vaguely) understand that GLMakie internally keeps its values as Float32s but in this case is the conversion being done prematurely?

I’m using GLMakie 0.8.6, Julia 1.9.2 on Windows 10.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [July 18, 2023, 4:45pm UTC](https://discourse.julialang.org/t/glmakie-yscale-log10-and-float32/101731/2 "2023-07-18T16:45:18Z")

</div>

Yes conversion is currently done immediately, there is a PR in the works that might shift Float32 conversion to a later point but it hasn’t reached a mergeable state, yet.

---

<div class="post-metadata">

**Author:** ![tt1234567](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Post date:** [July 18, 2023, 6:04pm UTC](https://discourse.julialang.org/t/glmakie-yscale-log10-and-float32/101731/3 "2023-07-18T18:04:22Z")

</div>

That would be useful - thanks for the explanation!

---

<div class="post-metadata">

**Author:** ![Kazi\_Abu\_Rousan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kazi_abu_rousan/32/30942_2.png) [@Kazi\_Abu\_Rousan](https://discourse.julialang.org/u/Kazi_Abu_Rousan)\
**Post date:** [December 27, 2023, 4:39pm UTC](https://discourse.julialang.org/t/glmakie-yscale-log10-and-float32/101731/4 "2023-12-27T16:39:00Z")

</div>

any update on this?, how to work around?
