# Problem with savefig from Plots package

**URL:** <https://discourse.julialang.org/t/problem-with-savefig-from-plots-package/33877>\
**Category:** General Usage\
**Tags:** package, error\
**Created:** [January 27, 2020, 10:27pm UTC](https://discourse.julialang.org/t/problem-with-savefig-from-plots-package/33877 "2020-01-27T22:27:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergevic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergevic/32/9958_2.png) [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Post date:** [January 27, 2020, 10:27pm UTC](https://discourse.julialang.org/t/problem-with-savefig-from-plots-package/33877/1 "2020-01-27T22:27:17Z")

</div>

I had the following code that worked well until today. I didn’t change anything, only Julia version.

```julia
using Plots
using Printf
function plotrand(t)
       plot(rand(10),rand(10))
       sav=@sprintf("%d",t)
       savefig(sav)
end
map(plotrand,1:5)

```

The function worked perfectly when I was using Julia 1.0.3 with Atom but doesn’t work anymore with Julia 1.1.1. I get the following error:

`ERROR: SystemError: opening file "C:\\Users\\User\\AppData\\Local\\Temp\\jl_A660.tmp.png": No such file or directory`

Can anyone tell me what’s happening? Why does the code fail now if I didn’t change anything?

---

<div class="post-metadata">

**Author:** ![lineycroc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lineycroc/32/10078_2.png) [@lineycroc](https://discourse.julialang.org/u/lineycroc)\
**Post date:** [January 28, 2020, 2:22pm UTC](https://discourse.julialang.org/t/problem-with-savefig-from-plots-package/33877/2 "2020-01-28T14:22:56Z")

</div>

Your code works for me fine on Jupyter with Julia 1.1.1.

Maybe it’s something with the folder you’re running in? The end of your path name (jl\_A660.tmp.png) seems a bit odd. The code as written saves files 1.png-5.png for me, not “jl\_A660.tmp.png”.

---

<div class="post-metadata">

**Author:** ![sergevic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergevic/32/9958_2.png) [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Post date:** [January 28, 2020, 3:11pm UTC](https://discourse.julialang.org/t/problem-with-savefig-from-plots-package/33877/3 "2020-01-28T15:11:28Z")

</div>

As I said , I didn’t change anything and simply run the same code but on Julia 1.1.1. The error message is one of the messages I get because it changes when I try to run the code again
