# After trying to plot negative values using \`yaxis = :log10\`, all plots breaks down

**URL:** <https://discourse.julialang.org/t/after-trying-to-plot-negative-values-using-yaxis-log10-all-plots-breaks-down/129167>\
**Category:** Visualization\
**Tags:** plots\
**Created:** [May 20, 2025, 8:07am UTC](https://discourse.julialang.org/t/after-trying-to-plot-negative-values-using-yaxis-log10-all-plots-breaks-down/129167 "2025-05-20T08:07:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [May 20, 2025, 8:07am UTC](https://discourse.julialang.org/t/after-trying-to-plot-negative-values-using-yaxis-log10-all-plots-breaks-down/129167/1 "2025-05-20T08:07:17Z")

</div>

Basically, I (by misstake) tried to plot something where the values go negative and I asked for a log scaled y axis. Ofcourse this failed. However, it also meant that all other plots failed.

It would be good if this could be fixed generally (although it seems it already have? [[BUG] Bad values with yscale=:log10 break follow-up plots in GR · Issue #3321 · JuliaPlots/Plots.jl · GitHub](https://github.com/JuliaPlots/Plots.jl/issues/3321)). However, in the meantime, how do I just get plotting to work again? I have quite a lot of stuff loaded, and will have to sit through ages of precompilation again if I restart Julia to reset it (yes, I have no idea why things keep precompiling again, I asked around and this just seems to be a thing that Julia does).

Somewhat minimal example:

```julia
using Plots
plot(-10:10, -10:10) # Fine.
plot(-10:10, -10:10; yaxis = :log10)# Blank plot.
plot(-10:10, -10:10) # Mostly blank plot.

```

---

<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:** [May 20, 2025, 9:37am UTC](https://discourse.julialang.org/t/after-trying-to-plot-negative-values-using-yaxis-log10-all-plots-breaks-down/129167/2 "2025-05-20T09:37:53Z")

</div>

> [@Torkel](#):
>
> However, in the meantime, how do I just get plotting to work again?

For the logarithmic plots you can do:

```julia
x = y = -10:10
ix = y .> 0
plot(x[ix], y[ix]; yaxis=:log10)

```

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [May 20, 2025, 9:42am UTC](https://discourse.julialang.org/t/after-trying-to-plot-negative-values-using-yaxis-log10-all-plots-breaks-down/129167/3 "2025-05-20T09:42:01Z")

</div>

So the problem is not plotting lograithmic stuff. The problem is that I accidentally plotted one, and now I cannot make any plot whatsoever. I.e. just `plot(-10:10, -10:10)` which is totally fine just gives a blank plane.

---

<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:** [May 20, 2025, 10:20am UTC](https://discourse.julialang.org/t/after-trying-to-plot-negative-values-using-yaxis-log10-all-plots-breaks-down/129167/4 "2025-05-20T10:20:30Z")

</div>

I think this bug has not been fixed: [[BUG] Assertion error `total_plotarea_vertical \> 0mm`. Plots remains unusable afterwards · Issue #4816 · JuliaPlots/Plots.jl · GitHub](https://github.com/JuliaPlots/Plots.jl/issues/4816#issuecomment-2408638461)

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [May 20, 2025, 10:22am UTC](https://discourse.julialang.org/t/after-trying-to-plot-negative-values-using-yaxis-log10-all-plots-breaks-down/129167/5 "2025-05-20T10:22:19Z")

</div>

Thanks! Good to know that it is reported at least
