I have a problem, probably due to plotting a lot of graphs. I can’t plot anymore. Either using pyplot() or gr() as backend the plot window / gui does not comes out, I try with working codes and the window never shown again, but on REPL the codes run.
What to do to fix the plotting GUI/window problem? (I suspect this is due to the plot of step function I tried tremendously yesterday [x + 1/2]
This is the problematic codes:
using Plots, LaTeXStrings, Plots.PlotMeasures
pyplot()
f(x) = floor(x + 1/2)
x = -5.5:1:4.5
y = f.(x)
plot(x[1:2], [y[1], y[1]], label=L"f(x) = \lfloor x + 1/2 \rfloor", legend=:bottomleft,legend_foreground_color=:white,
legend_font_color=:blue, color=:blue, showaxis=false, tickfontcolor=:white)
# axis
hline!((0,0), color=:black, label="")
vline!((0,0), color=:black, label="")
# Scale values
for i in x
if i!= 0
annotate!(i,-0.2, (i, 7))
end
end
for i in y
if i != 0
annotate!(-.2, i, (i, 7))
end
end
annotate!(-.2, -.2, ("0", 7))
# Plot function
for i in 2:length(x)-1
plot!(x[i:i+1], [y[i], y[i]], label="", color=:blue, lw=2)
end
The codes run without error or warning but the GUI/window is not showing (attachment below):