# Png(p, file\_name) always shows the plot \[Plots.jl, GR\]

**URL:** <https://discourse.julialang.org/t/png-p-file-name-always-shows-the-plot-plots-jl-gr/134225>\
**Category:** Visualization\
**Tags:** plotting, bug\
**Created:** [November 29, 2025, 8:03pm UTC](https://discourse.julialang.org/t/png-p-file-name-always-shows-the-plot-plots-jl-gr/134225 "2025-11-29T20:03:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdamWysokinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamwysokinski/32/206422_2.png) [@AdamWysokinski](https://discourse.julialang.org/u/AdamWysokinski)\
**Post date:** [November 29, 2025, 8:03pm UTC](https://discourse.julialang.org/t/png-p-file-name-always-shows-the-plot-plots-jl-gr/134225/1 "2025-11-29T20:03:26Z")

</div>

Hi,  
I think the behaviour of show() has changed recently. Calling:

```julia-auto
using Plots
p = plot(rand(10));
png(p, tempname())

```

always shows the plot.

Same for:

```julia-auto
using Plots
p = plot(rand(10));
io = PipeBuffer()
png(p, io);
# or
show(io, MIME("image/png"), p)

```

Is there any way to suppress it or is it a bug?

---

<div class="post-metadata">

**Author:** ![AdamWysokinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamwysokinski/32/206422_2.png) [@AdamWysokinski](https://discourse.julialang.org/u/AdamWysokinski)\
**Post date:** [December 1, 2025, 5:28pm UTC](https://discourse.julialang.org/t/png-p-file-name-always-shows-the-plot-plots-jl-gr/134225/2 "2025-12-01T17:28:49Z")

</div>

> [@AdamWysokinski](#):
>
> ```julia-auto
> using Plots
> p = plot(rand(10));
> png(p, tempname())
> 
> ```

One way to disable showing the plot is:

```julia-auto
using Plots
p = plot(rand(10));
withenv("GKSwstype" => "100") do
    png(p, io)
end

```
