Savefig causes a flash on the display

Calling savefig(“file”) writes the file, and the plots are as expected. But every call causes the screen to flash. I believe the plot is momentarily displayed and the plot window removed before the file is written. Running a long program that creates many plots makes the machine unusable. Sometimes I also get errors written to the terminal:

read: Connection reset by peer
send: Broken pipe

This happens with both Julia 1.5 and 1.6.0-rc1, on Ubuntu Linux. I put semicolons after all calls to plot and savefig. I don’t understand why savefig just doesn’t write to the file without trying to display a plot window.

Replying to my own comment to say that recent versions of Plots no longer have this problem.

Replying much later!

With Julia 1.12.4 and Plots v1.41.4 with the gr backend, savefig(); pops up an unwanted plot on the display.