# Disable warnings in \`Plots\`

**URL:** <https://discourse.julialang.org/t/disable-warnings-in-plots/93838>\
**Category:** Visualization\
**Tags:** plots, logging\
**Created:** [January 31, 2023, 8:24pm UTC](https://discourse.julialang.org/t/disable-warnings-in-plots/93838 "2023-01-31T20:24:46Z")\
**Posts on this page:** 4\
**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:** [January 31, 2023, 8:24pm UTC](https://discourse.julialang.org/t/disable-warnings-in-plots/93838/1 "2023-01-31T20:24:46Z")

</div>

I am `using Plots` to `plot(data,options...)`. This produces tons of `Warning`s like:

```julia
┌ Warning: Indices Base.OneTo(7) of attribute `fillcolor` does not match data indices 1:6.
└ @ Plots ~/.julia/packages/Plots/AAjgN/src/utils.jl:128
┌ Warning: Indices Base.OneTo(7) of attribute `markercolor` does not match data indices 1:6.
└ @ Plots ~/.julia/packages/Plots/AAjgN/src/utils.jl:128
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/igbcf/src/ticks.jl:191
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/igbcf/src/ticks.jl:191

```

like, these are useful, but I can generate the plots I want now. Is there a way to disable them (like `verbosity=false`) so that my REPL don’t get spammed asunder?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 31, 2023, 8:33pm UTC](https://discourse.julialang.org/t/disable-warnings-in-plots/93838/2 "2023-01-31T20:33:24Z")

</div>

You can do:

```julia
julia> using Logging

julia> Logging.disable_logging(Logging.Info)
LogLevel(1)

julia> @warn "test"
┌ Warning: test
└ @ Main REPL[6]:1

julia> Logging.disable_logging(Logging.Warn)
LogLevel(1001)

julia> @warn "test"

```

See the docs [Logging · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Logging/) for more infos.

Edit: I didn’t checked if it is working for your specific warnings you get from Plots, because I wasn’t able to produce some in a timely manner.

---

<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:** [January 31, 2023, 10:42pm UTC](https://discourse.julialang.org/t/disable-warnings-in-plots/93838/3 "2023-01-31T22:42:06Z")

</div>

Thanks for the reply, I’d probably prefer not having to mess with logging, however, maybe that is the only option. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [January 31, 2023, 11:34pm UTC](https://discourse.julialang.org/t/disable-warnings-in-plots/93838/4 "2023-01-31T23:34:50Z")

</div>

Try this:

```julia
using Logging, Plots

with_logger(NullLogger()) do
   plot(data, options...)
end

```

That will suppress everything.

If you still want to see errors, try this:

```julia
with_logger(ConsoleLogger(Error)) do
    plot(data, options, ...)
end

```
