I’m using Plots.jl with the default backend to plot an image and save the figure.
using Plots: plot, savefig
plot(rangex,rangey,some_image,xticks,yticks,...);
savefig("name.jpg");
this works perfectly fine with Juno IDE on Windows. But my final code is expected to run in the terminal. When I try to run the same code in terminal it becomes super slow and in each plot I see a GKS QtTerm window appear and disappear for a moment. Is there a way to disable this window?
EDIT: Here I did some tests about runtime, and I used 100 iterations of plot() function.
In Atom Juno:
starting julia + loading libraries & functions took about 36s
doing 100 plot iterations took about 55s
total of 91 seconds.
In Windows cmd:
starting julia + loading libraries & functions took about 21s
doing 100 plot iterations took about 284 seconds
total of 305 seconds.
A Plot is only displayed when returned (a semicolon will suppress the return), or if explicitly displayed with display(plt) , gui() , or by adding show = true to your plot command.
I’m using the semicolon, and additionally, I just tried the show = false parameter in plot() function. however, the window still flashes when ran from the terminal.
maybe it is just a windows issue. I directly run the code from the windows command line
cmd > julia.exe mycode.jl
In my code, I use a for loop and I call plot() function inside this loop. If it was to compile libraries or functions in the first iteration, I would totally understand. But it doesn’t seem like that, and it is slow on every iteration.
starting the IDE and getting the libraries ready takes about 70 seconds. But I do @time only when the iterations start, after the libraries are loaded, so the terminal adds up another 80 seconds to this time.
EDIT: I will clarify the runtimes after doing some tests and add them to the post.