Greetings everyone,
I don’t want to plot my functions every time I run the script and I don’t want Plots to load when I’m not plotting, but I found that I can’t place the
using Plots
statement inside an if/else statement. i.e.
print("Generate a diagram as a visual check? (Yes=1, No=0): ")
YN=parse(Float64,readline())
if YN != 1
println("No diagram.")
else
using Plots
plotly()
etc.etc.
The only workaround I could guess is to do the following:
print("Generate a diagram as a visual check? (Yes=1, No=0): ")
YN=parse(Float64,readline())
if YN != 1
println("No diagram.")
exit(0) # force exit to avoid loading the Plots module
end
using Plots
plotly()
I’m not excited about forcing the script to end, although it works for me as it’s the final step in the script.
Is there are proper way to achieve this?
P.