# Plotting in log scale with zeros

**URL:** <https://discourse.julialang.org/t/plotting-in-log-scale-with-zeros/47260>\
**Category:** Visualization\
**Created:** [September 25, 2020, 12:51pm UTC](https://discourse.julialang.org/t/plotting-in-log-scale-with-zeros/47260 "2020-09-25T12:51:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gideonsimpson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gideonsimpson/32/1928_2.png) [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Post date:** [September 25, 2020, 12:51pm UTC](https://discourse.julialang.org/t/plotting-in-log-scale-with-zeros/47260/1 "2020-09-25T12:51:08Z")

</div>

When using `Plots.jl`, is there a straightforward way to plot on log scale with data which might contain zeros? When using `matplotlib` in Python, these values are just filtered and an image is still rendered, but `Plots.jl` throws an error. Do I just have to manually filter those values out?

---

<div class="post-metadata">

**Author:** ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)\
**Post date:** [September 25, 2020, 1:05pm UTC](https://discourse.julialang.org/t/plotting-in-log-scale-with-zeros/47260/2 "2020-09-25T13:05:36Z")

</div>

I thought this was partly fixed, test case:

```julia
using Plots
plot(cumsum(randn(1000,4), dims=1), yaxis=(:log10, [0.1, :auto]))

```

If you don’t specify `ylims` then it gets confused. (Ref: [this issue?](https://github.com/JuliaPlots/Plots.jl/issues/1959))

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [September 25, 2020, 1:52pm UTC](https://discourse.julialang.org/t/plotting-in-log-scale-with-zeros/47260/3 "2020-09-25T13:52:14Z")

</div>

[https://github.com/JuliaPlots/Plots.jl/pull/2962](https://github.com/JuliaPlots/Plots.jl/pull/2962) that issue should be fixed now

---

<div class="post-metadata">

**Author:** ![gideonsimpson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gideonsimpson/32/1928_2.png) [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Post date:** [September 26, 2020, 2:11pm UTC](https://discourse.julialang.org/t/plotting-in-log-scale-with-zeros/47260/4 "2020-09-26T14:11:47Z")

</div>

Yes, as soon as i specify the limits in that way, it works fine.
